$ xcode-select --install
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update
$ brew install wget vim
$ brew install homebrew/apache/httpd24
$ brew install homebrew/apache/mod_fastcgi --with-brewed-httpd24
$ mkdir /usr/local/var/apache2/fastcgi
$ brew install php56 --with-httpd24
$ brew install \
homebrew/php/php53-imagick \
homebrew/php/php53-gmagick \
homebrew/php/php53-mcrypt \
homebrew/php/php53-crypto \
homebrew/php/php53-pdo-dblib \
homebrew/php/php53-mysqlnd_ms
$ brew unlink php53
$ brew install php56 --with-httpd24
$ brew install \
homebrew/php/php56-imagick \
homebrew/php/php56-mcrypt \
homebrew/php/php56-gmagick \
homebrew/php/php56-crypto \
homebrew/php/php56-mysqlnd_ms \
homebrew/php/php56-pdo-dblib
$ sudo vim /usr/local/etc/apache2/2.4/httpd.conf
# fastcgi_module
LoadModule fastcgi_module /usr/local/Cellar/mod_fastcgi/2.4.6/libexec/mod_fastcgi.so
# php5_module
#LoadModule php5_module /usr/local/Cellar/php53/5.3.29_7/libexec/apache2/libphp5.so
LoadModule php5_module /usr/local/Cellar/php56/5.6.29_5/libexec/apache2/libphp5.so
# Custom Config
Include /usr/local/etc/apache2/2.4/mods/*.conf
# VHost Config
Include /usr/local/etc/apache2/2.4/vhosts/*.conf
$ sudo vim /usr/local/etc/apache2/2.4/mods/php5_module.conf
<IfModule php5_module>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</IfModule>
$ sudo vim /usr/local/etc/apache2/2.4/mods/fastcgi_module.conf
<IfModule fastcgi_module>
AddHandler fastcgi-script .fcgi
<Directory "/usr/local/var/apache2/cgi-bin-php">
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>
# mkdir /usr/local/var/apache2/fastcgi
FastCgiIpcDir /usr/local/var/apache2/fastcgi
FastCgiConfig -idle-timeout 110 -killInterval 120 -pass-header HTTP_AUTHORIZATION -autoUpdate
</IfModule>
$ sudo vim /usr/local/var/apache2/cgi-bin-php/php-cgi-5.3.29.fcgi
#!/bin/sh
version="5.3"
shortversion="53"
PHPRC=/usr/local/etc/php/${version}/php.ini
export PHPRC
PHP_FCGI_CHILDREN=3
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
# /usr/local/bin/php-cgi ->
exec /usr/local/Cellar/php${shortversion}/${version}.29_7/bin/php-cgi
$ sudo chmod 755 /usr/local/var/apache2/cgi-bin-php/php-cgi-5.3.29.fcgi
$ sudo vim /usr/local/etc/apache2/2.4/vhosts/php53.siswadi.com.conf
<VirtualHost *:80>
DocumentRoot "/Users/siswadi/WWW/php53.siswadi.com/public_html"
ServerName siswadi.com
ServerAlias www.siswadi.com
<Directory "/Users/siswadi/WWW/php53.siswadi.com/public_html">
AllowOverride All
allow from all
Options +FollowSymLinks
</Directory>
<IfModule fastcgi_module>
AddHandler php-cgi .php
Action php-cgi /cgi-bin-php/php-cgi-5.3.29.fcgi
<FilesMatch "\.php$">
SetHandler php-cgi
</FilesMatch>
</IfModule>
ErrorLog "/usr/local/var/log/apache2/php53.siswadi.com-error_log"
CustomLog "/usr/local/var/log/apache2/php53.siswadi.com-access_log" common
</VirtualHost>
$ sudo vim /usr/local/etc/apache2/2.4/vhosts/php56.siswadi.com.conf
<VirtualHost *:80>
DocumentRoot "/Users/siswadi/WWW/php56.siswadi.com/public_html"
ServerName store.siswadi.com
<Directory "/Users/siswadi/WWW/php56.siswadi.com/public_html">
AllowOverride All
allow from all
Options +FollowSymLinks
</Directory>
ErrorLog "/usr/local/var/log/apache2/php56.siswadi.com-error_log"
CustomLog "/usr/local/var/log/apache2/php56.siswadi.com-access_log" common
</VirtualHost>
$ sudo vim /etc/hosts
127.0.0.1 php53.siswadi.com
127.0.0.1 php56.siswadi.com
$ vim /Users/siswadi/WWW/siswadi.com/public_html/index.php
<? phpinfo() ?>
$ vim /Users/siswadi/WWW/siswadi.com.store/public_html/index.php
<? phpinfo() ?>
$ sudo apachectl restart
- Open Web Browser
- Open http://php53.siswadi.com/
PHP Version 5.3.29
PHP Version 5.5.9
PHP Version 5.6.0
PHP Version 7.0.13
- Done