Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So i did simple thing:

php -i | head
./configure --prefix=/usr --with-snmp
make
sudo make install

But phpinfo() still showing me 5.3.15. Here some results of investigations:

  • PHP_BINDIR = /usr/bin
  • phpversion() = 5.3.15
  • 192-168-0-100:$ /usr/bin/php -v
    PHP 5.4.8 (cli) (built: Nov 8 2012 09:30:58)
  • 192-168-0-100:$ /usr/local/bin/php -v
    PHP 5.4.8 (cli) (built: Nov 7 2012 22:09:56)
  • 192-168-0-100:$ which php
    /usr/bin/php

Also tried plying with different ln -s. May be some suggestions?

P.S. php is working fine on localhost, but it is still 5.3 (tried some new features from php 5.4)

share|improve this question

1 Answer 1

Instead of building yourself and potentially wreaking havoc in your /bin directory—this might kill your original PHP installation—do yourself a favor and use prebuilt installations like those below.


MAMP

MAMP currently ships with PHP 5.2 and 5.4.4. It'll run standalone and you can switch anytime.

MAMP is installed in the typical Mac fashion: very easily. MAMP will not compromise any existing Apache installation already running with your OS X. You can install Apache, PHP and MySQL without starting a script or having to change any configuration files!

 

PHP Binary Packages

You can also try the PHP 5.3/5.4 for OS X as binary packages:

This package installs the (usually) latest PHP 5.3.x/5.4.x […] in /usr/local/php5. It installs many useful extensions […]. It also provides a decent php.ini with all settings configured according to "Best Practices".

For PHP 5.4, installation is as easy as running:

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4
share|improve this answer
    
Alternatively, I would recommend installing with homebrew –  Kevin C. Mar 6 '13 at 19:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.