PHP 5.6 Mac OSX 10.11.6 (El Capitan)

Check your apache version.

httpd -v
Server version: Apache/2.4.25 (Unix)

Installing PHP 5.6 With Mac OSX Default Apache

brew install php56 --with-apache

# to start apache service at boot
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

# to start apache service manually
sudo apachectl start

For full list of options when installing php56:

brew options php56

Configure httpd.conf:

sudo vim /etc/apache2/httpd.conf
# load PHP 5.6 module
LoadModule php5_module /usr/local/Cellar/php56/5.6.29_5/libexec/apache2/libphp5.so

<IfModule php5_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    <IfModule dir_module>
        DirectoryIndex index.html index.php
    </IfModule>
</IfModule>

Installing PHP 5.6 With Homebrew httpd24

brew install php56 --with-httpd24

# to start apache service at boot
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

# to start apache service manually
sudo apachectl start

Configure httpd.conf:

sudo vim /usr/local/etc/apache2/2.4/httpd.conf
# load PHP 5.6 module
LoadModule php5_module /usr/local/Cellar/php56/5.6.29_5/libexec/apache2/libphp5.so


<IfModule php5_module>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    <IfModule dir_module>
        DirectoryIndex index.html index.php
    </IfModule>
</IfModule>