UPDATED: Install PHP 5.2 stack from source on Mac OS X 10.6 Snow Leopard using Homebrew
Posted on Feb 2 2010 - 6:51pm
I've updated the instructions to build a nice clean and fast PHP 5.2 stack using my own build scripts and the homebrew build system.
All software is installed into /usr/local for easy management and while it works with the included OS X Apache and libraries where possible it is installed in such a way that system updates from Apple don't clobber anything.
I use this stack as my local PHP and Drupal development environment.
The instructions are rather verbose but if you don't really care how it's done I've attached a build script that will do everything except the final configuration work.
#!/bin/bash
if [ -d /usr/local ]; then
echo "moving existing /usr/local to /Users/`whoami`/local.bak"
sudo mv /usr/local ~/local.bak
fi
sudo mkdir /usr/local && sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
brew install git
cd /usr/local
git init
git remote add origin git://github.com/mxcl/homebrew.git
git pull origin master
git remote add boztek git://github.com/boztek/homebrew.git && git fetch boztek
git checkout boztek/php52 && git checkout -b working
git pull --rebase origin master
brew install php52 --with-mysql --with-apache
Ain't git grand?
| Attachment | Size |
|---|---|
| build-lamp-php52-snowleopard.sh | 1.85 KB |