Igor Simic
3 years ago

How to update PHP version on your MacBook - macOS Sierra


Updating PHP version on your macOS is something that you need to do from time to time. As new PHP versions are coming out you would have to update PHP version on your macOS. So, how to do it:

first check your current version by typing this command:
php -v
if your PHP needs t o be updated type this line:
curl -s http://php-osx.liip.ch/install.sh | bash -s 7.1
"7.1" is going to be updated version - please change this number to latest version

wait until update process is finished, and check your php version again

php -v
if you do not see the new version number in output, try with this command:
export PATH=/usr/local/php5/bin:$PATH
and now try again with
php -v
now you should see something like this:
PHP 7.1.8 (cli) (built: Aug 17 2017 17:06:19) ( NTS )
Copyright (c) 1997-2017 The PHP Group