multiple php with homebrew on mavericks

assume you have nginx + homebrew already installed
brew update
brew tap josegonzalez/php
brew tap homebrew/dupes
brew options php53
brew install php53 --with-mariadb --with-suhosin --with-fpm
brew install php53 --with-mariadb --with-suhosin --with-fpm
brew install php55 --with-mariadb --with-suhosin --with-fpm
cd /usr/local/Cellar/
cp php53/5.3.28/homebrew.mxcl.php53.plist /Users/sirolf/Library/LaunchAgents/.
cp php54/5.4.29/homebrew.mxcl.php54.plist /Users/sirolf/Library/LaunchAgents/.
cp php55/5.5.13/homebrew.mxcl.php55.plist /Users/sirolf/Library/LaunchAgents/.
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php53.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php54.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php55.plist
cd /usr/local/etc/nginx/
mv php.conf php53.conf
cp php53.conf php55.conf
cp php53.conf php54.conf
nano php55.conf
Change port to 9090
nano php54.conf
change port to 9001
nano /usr/local/etc/php/5.3/php-fpm.conf
nano /usr/local/etc/php/5.4/php-fpm.conf
nano /usr/local/etc/php/5.5/php-fpm.conf
Update the ports accodingly
now add the needed console dependancies
brew install php53-uploadprogress
brew install php53-xdebug
brew install php53-xhprof
brew install php53-uploadprogress
brew install php54-xdebug
brew install php54-xhprof
brew install php55-uploadprogress
brew install php55-xdebug
brew install php55-xhprof
Now add aliasses to .bash_rc
alias use_php53="brew unlink php54 && brew unlink php55 && brew unlink php53 && brew link php53"
alias use_php54="brew unlink php53 && brew unlink php55 && brew unlink php54 && brew link php54"
alias use_php55="brew unlink php53 && brew unlink php54 && brew unlink php55 && brew link php55"
to flush dnscache
dscacheutil -flushcache;sudo killall -HUP mDNSResponder

 

Hessen Kasselstraat 8
5615 SM Eindhoven
phone: +316-81888456