Server Fault is a question and answer site for system and network administrators. 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

I used a nice one-line command to install PHP 5.4 Mac OS X Lion, from This is working perfectly in Apache – my local sites are now using PHP 5.4.

But when I run php -v from the terminal, it still uses version 5.3. This is causing problems.

which php gives me /usr/bin/php, so that's where the old version is still installed. And after some digging I've found that the 5.4 binary is located at /usr/local/php5/bin/php.

So I'm nearly there... But how do I make the php command resolve to /usr/local/php5/bin/php?

share|improve this question

closed as off topic by Michael Hampton, Ward, mdpc, RolandoMySQLDBA, kce Jan 28 '13 at 2:41

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 3 down vote accepted

If you don't need the old copy of the file, you can just remove it and create a symbolic link to /usr/local/php5/bin/php. You can use ln -s command. This will be easier than playing with your PATH variable.

share|improve this answer
Thank you, that works. I didn't delete /usr/bin/php, I just renamed it to php_OLD just in case... – callum Jun 3 '12 at 13:34
@callum: That's better :) – Khaled Jun 3 '12 at 13:54
@Khaled I am also having the same issue. I followed your answer and now It does show new version with php -v command but using phpinfo() function shows older version. Could you please look at my post – x4ph4r Jan 27 '13 at 9:22

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