Macos – MAC php version not updating

macosPHP

I'm trying to update php on my local machine by running the below command:

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6

The result of the command are as follows:

chris$ curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6
Detected OS X Mavericks 10.9 All ok.
Get packager.tgz
Unpack packager.tgz
Please type in your password, as we want to install this into /usr/local
Password:
Start packager (may take some time)
downloading http://php-osx.liip.ch/install/5.6-10.8-frontenddev-latest.dat
downloading http://php-osx.liip.ch/install/5.6-10.8/frontenddev/5.6-10.8-frontenddev-5.6.19-20160310-141036.tar.bz2

Installing package 5.6-10.8-frontenddev into root /
Package 5.6-10.8-frontenddev is already installed at version 5.6.19-20160310-141036. You wanted to install version 5.6.19-20160310-141036.

Then when I check the version is saying version 5.4:

php -v

PHP 5.4.30 (cli) (built: Jul 29 2014 23:43:29)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

Best Answer

I am having a similar issue. I found this page: http://php-osx.liip.ch

It says this:

Frequently Asked Questions

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 everything 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

It worked for my issue.

Related Question