LoadModule php7_module libexec/apache2/libphp7.so This will modify our Apache /etc/apache2/nf and will add the following line: OS X Yosemite comes with Apache 2.4 installed, so all we need to do is ensure PHP7 is compiled with flag -with-apxs2 enabled, which we already provided in my configure script mentioned in my previous article. Defines the default timezone used by the date functions Best is you set it to the timezone you prefer (e.g. In PHP7 if you omit to change the date.timezone, it will be set to UTC by default which might cause some conflicts if you have time and date operations. When we now run php -v on the commandline, we now see xdebug is installed correctly. Zend_extension=/opt/php7/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so Now we need to add the xdebug configuration in it. $ sudo cp /tmp/php-7.0.0/php.ini-development /etc/php7/php.ini Since this is a clean installation, we can easily copy the supplied php.ini-development into our configration path. This also means we need to ensure a php.ini file is there. In the configuration of PHP7 in my previous article, I had stated that our configuration was going to be installed in /etc/php7 (see -with-config-file-path=/etc/$ argument). Now we have the extension installed, we need to inform PHP7 we have the extension available. $ sudo cp modules/xdebug.so /opt/php7/lib/php/extensions/no-debug-non-zts-20151012/ This will create a xdebug.so shared object we need to copy to our PHP7 installation extension directory. Now all we need to do is to run make and make test to complete the build. configure -enable-xdebug -with-php-config=/opt/php7/bin/php-config Once done, we need to phpize and configure XDebug using our installed PHP7 in /opt/php7. Get the latest XDebug package (at this time of writing it's xdebug-4.2.0RC2), check the signature and unpack 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. When running PHP you also want to have XDebug compiled into it. Use #Docker > docker run zend/php-zendserver:9.0rc9-php7.0GA
If you would like to keep your system clean, there's also a Docker installation for PHP7 provided by Zend Technologies, Inc.
#Install apache on mac yosemite install
Saves you a bunch of manual work.īut 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 already have one of these PIM's configured, by all means use them. 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. There will be probably more tools out there, but these were the suggestions made by some of my readers.Īgain, I have nothing against these tools and I value their functionality a lot. 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.
#Install apache on mac yosemite how to
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. 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.