MacOS – Why does the OS X still run older php even though I updated it

macmacosPHP

I have just updated my system php in terminal via command line.

I deleted the export path in .bash_profile as it was pointing to mamp but for some reason my php still says 5.3 not 5.4 when I run php -v in terminal.

Does anyone know why this would happen. I have also closed terminal and reopened to see the change.

Best Answer

It seems as you did not add the new path to your $PATH.

Citing the FAQ of the website that you have posted:

Why does php -v on the command line still show my old version?

php-osx doesn't overwrite the php binaries installed by Apple, but installs everyting in /usr/local/php5. The new php binary is therefore in /usr/local/php5/bin/php.

You can also adjust your PATH do include that directory, eg. write into your ~/.profile file the following

export PATH=/usr/local/php5/bin:$PATH

So open you .profile or .bash_profile in a editor like nano or vim and add the last line export PATH=/usr/local/php5/bin:$PATH to the appropiate file.

Source your file with source ~/.bash_profile or source ~/.profile or close and reopen your terminal.