Skip to content

Instantly share code, notes, and snippets.

@biojazzard
Created April 22, 2014 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biojazzard/11175293 to your computer and use it in GitHub Desktop.
Save biojazzard/11175293 to your computer and use it in GitHub Desktop.
brew php53 stuff
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php5_module /usr/local/opt/php53/libexec/apache2/libphp5.so
The php.ini file can be found in:
/usr/local/etc/php/5.3/php.ini
✩✩✩✩ PEAR ✩✩✩✩
If PEAR complains about permissions, 'fix' the default PEAR permissions and config:
chmod -R ug+w /usr/local/Cellar/php53/5.3.28/lib/php
pear config-set php_ini /usr/local/etc/php/5.3/php.ini
✩✩✩✩ Extensions ✩✩✩✩
If you are having issues with custom extension compiling, ensure that
you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:
PATH="/usr/local/bin:$PATH"
PHP53 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.
✩✩✩✩ PHP CLI ✩✩✩✩
If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc,
~/.zshrc, ~/.profile or your shell's equivalent configuration file:
export PATH="$(brew --prefix homebrew/php/php53)/bin:$PATH"
To have launchd start php53 at login:
ln -sfv /usr/local/opt/php53/*.plist ~/Library/LaunchAgents
Then to load php53 now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php53.plist
==> Summary
🍺 /usr/local/Cellar/php53/5.3.28: 480 files, 27M, built in 3.8 minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment