Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/PHP/Update PHP Stable Release on Mac

March 7, 2016

Update PHP Stable Release on Mac

PHP is installed by default on all Macs since OS X version 10.0.0. You can install and use MAMP, but if you prefer to use the pre-loaded version of PHP, then you may need to update it to the latest stable release. Fortunately, there’s a binary package out there that will simplify your life.

If you like to install PHP 5.6 stable release, all you need to do is run the following from the command line:

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

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

If you feel adventurous, you can try PHP 7 stable release.

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

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

The installer packager will ask you for your password. PHP will be installed in /usr/local/php5.

Edit your .profile and include the PATH of the new PHP version.

nano ~/.profile

nano ~/.profile

Insert the following:

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

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

To be sure your using the new version, check the PHP version:

php -v

php -v

You should see something similar to this:

PHP 5.6.19 (cli) (built: Mar  4 2016 22:35:42) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

PHP 5.6.19 (cli) (built: Mar 4 2016 22:35:42) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans

You now have the latest PHP 5.6 stable release.

Filed Under: PHP Tagged With: install, upgrade

Have content delivered to your mail. Subscribe below.

About Me

I'm Ulysses, Cloud Engineer at Cardinal Health based in Columbus. This blog is about Linux and Cloud technology. When off the grid, I enjoy riding my electric skateboard. I've surfed, snowboarded and played the saxophone in the past. I hope you find this website helpful. It's powered by WordPress and hosted on AWS LightSail.

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021