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?

1 Answer 1

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.

3
  • Thank you, that works. I didn't delete /usr/bin/php, I just renamed it to php_OLD just in case...
    – callum
    Jun 3, 2012 at 13:34
  • @callum: That's better :)
    – Khaled
    Jun 3, 2012 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
    – Om3ga
    Jan 27, 2013 at 9:22

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