Installing PHP on OSX - HeyPublisher/heypublisher-submission-manager GitHub Wiki
Based on several pages around the net, this is what I've done:
-
Install the binary:
curl -s http://php-osx.liip.ch/install.sh | bash -s 7.2
-
Validate that the correct version of PHP was installed:
$ php -v
PHP 7.2.2 (cli) (built: Feb 1 2018 13:23:34) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.2, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans -
Manually assigning a PHP version:
The above script enables the different versions by changing the symlink
/usr/local/php5
like:php5 -> /usr/local/php5-7.2.2-20180201-132629
Simply change the symlink and restart apache (
sudo apachectl restart
) to change versions.