In my previous blog post “Installing PHP 7 on OS X Yosemite” I gave some insights on how to get quicly started with PHP7 on your Mac, specifically on your commandline. But before I continue on how to make it work with your installed Apache and MySQL I would like to address a subject many people found worth mentioning: PHP Installation Managers.
PHP Installation Managers
In the feedback I received on my article, people would like to point out that the package managers like “PHP-OSX” binary installer, “phpenv” multiversion php management and installer, “phpbrew” for installing and running multiple versions of PHP and “HomeBrew” the missing package manger for OS X. There will be probably more tools out there, but these were the suggestions made by some of my readers.
Again, I have nothing against these tools and I value their functionality a lot. The only reason I posted my article was to show people how you could have PHP 7 run immediately on your system without being too depending of any availability in a package manager or other tool. If you already have one of these PIM’s configured, by all means use them. Saves you a bunch of manual work.
But if you don’t have interest to install an additional tool, you can still follow these guidelines to have the latest and greatest PHP7 running on OS X.
If you would like to keep your system clean, there’s also a Docker installation for PHP7 provided by Zend Technologies, Inc.
The fastest way to try #PHP7. Use #Docker >> docker run zend/php-zendserver:9.0rc9-php7.0GA #zray is just a bonus pic.twitter.com/zhCpZON523
— Boaz Ziniman (@ziniman) December 7, 2015
XDebug
When running PHP you also want to have XDebug compiled into it. Unfortunately there’s not a stable release for XDebug 2.4, but I feel confident using the RC in the mean time as debugging is only something I will use locally.
Get the latest XDebug package (at this time of writing it’s xdebug-4.2.0RC2), check the signature and unpack it.
$ cd /tmp/
$ wget http://xdebug.org/files/xdebug-2.4.0rc2.tgz
$ md5check xdebug-2.4.0rc2.tgz e00e92bb2e72f7c94e1300b2a980e79e
OK
$ tar -xvzf xdebug-2.4.0rc2.tgz
$ cd xdebug-2.4.0RC2/
Once done, we need to phpize and configure XDebug using our installed PHP7 in /opt/php7.
Truncated by Planet PHP, read more at the original (another 11796 bytes)
Source: Planet PHP
