Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So i did simple thing:

php -i | head
./configure --prefix=/usr --with-snmp
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

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

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 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 | bash -s 5.4
share|improve this answer
Alternatively, I would recommend installing with homebrew – Kevin C. Mar 6 '13 at 19:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .