1. Links
  2. Apache
    1. Apache VHost
  3. PHP


Here's the link I followed to set this up: https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions

Here's another good link:



On my local macbook, first make sure the default installation of apache is not running:

sudo apachectl stop

FYI: I think the default php installation is here:


Then, I installed http from homebrew

brew install httpd

Here's how to set up the service (not sure exactly what this does):

sudo brew services start httpd

After running that, I can use this to control apache:

sudo apachectl -k restart sudo apachectl stop

Watch the logs like so:

tail -f /usr/local/var/log/httpd/error_log

Configuration is found here:


Apache VHost

I configured the vhost for dev.dryaddesigncompany.com. Don't forgetto add a line to hosts file as well.


I already had php installed on macbook, hopefully it'll work:

php --version PHP 5.6.30

By default, php is under /usr/bin/php. After using brew to install and configure, the binary to use is /usr/local/bin/php

Here's how I installed via homebrew:

brew tap homebrew/homebrew-php brew install php56 --with-httpd

Installed into:


It can be configured via:


Next, install v70:

brew unlink php56 brew install php70 --with-httpd brew unlink php70

Installed 70 here:


I haven't installed these yet:

brew install php71 --with-httpd brew unlink php71 brew install php72 --with-httpd

Here's a trick to make sure we're using the php56:

export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"

To switch back and forth between php versions:

brew unlink php72 brew link php56