1

I used a nice one-line command to install PHP 5.4 Mac OS X Lion, from php-osx.liip.ch. 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?

callum
  • 121
  • 1
  • 6

1 Answers1

3

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.

Khaled
  • 36,533
  • 8
  • 72
  • 99
  • Thank you, that works. I didn't delete `/usr/bin/php`, I just renamed it to `php_OLD` just in case... – callum Jun 03 '12 at 13:34
  • @callum: That's better :) – Khaled Jun 03 '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](http://serverfault.com/questions/472768/installed-new-version-of-php-but-server-still-uses-older-version) – Om3ga Jan 27 '13 at 09:22