Installing nginx/percona/php-fpm with homebrew on Mountain Lion
If it helps anyone else, that's an added bonus, but this is mainly just a reference point for me.
If it helps anyone else, that's an added bonus, but this is mainly just a reference point for me; I'm always forgetting what all needs to be done setting up a development environment going. MNPP doesn't seem to work well, and I'm too cheap at the moment to pay for for MAMP Pro. Plus, MAMP uses Apache which I've been trying to get away from for the past few months because of its slowness.
Preparation
# Get Xcode via the App Store and install command-line tools (1.6+GB)
# Grab homebrew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
# Grab the taps we'll need later
brew tap josegonzalez/homebrew-php
brew tap homebrew/dupes
Install Percona
This is a drop-in replacement for MySQL with built-in speed improvements. Double plus good.
brew install percona-server
brew link percona-server
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix percona-server)" --datadir=/usr/local/var/percona --tmpdir=/tmp
mkdir -p ~/Library/LaunchAgents
cp /usr/local/opt/percona-server/homebrew.mxcl.percona-server.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.percona-server.plist
Install nginx
This little guy's awesome. No overhead for static files. Can act as a reverse-proxy cache for HTTPS content. I prefer Varnish for HTTP, though.
brew install nginx
sudo cp `brew --prefix nginx`/homebrew.mxcl.nginx.plist /Library/LaunchDaemons/
sudo sed -i -e 's/`whoami`/root/g' `brew --prefix nginx`/homebrew.mxcl.nginx.plist
sudo mkdir /var/log/nginx/
Install php-fpm
PHP's fastcgi process manager. Kind of a resource hog, but better than using Apache/mod_php.
brew install --without-apache --with-fpm --with-mysql php54
sudo cp `brew --prefix php54`/homebrew-php.josegonzalez.php54.plist /Library/LaunchAgents/
sudo launchctl load -w /Library/LaunchAgents/homebrew-php.josegonzalez.php54.plist
php-fpm -v
sudo mv /usr/sbin/php-fpm /usr/sbin/php-fpm.bak
sudo ln -s /usr/local/Cellar/php54/5.4.11/sbin/php-fpm /usr/sbin/php-fpm
php-fpm -v
php -v
sudo mv /usr/bin/php /usr/bin/php.bak
sudo ln -s /usr/local/bin/php /usr/bin/php
php -v
echo 'export PATH=$PATH:/usr/local/sbin' >> ~/.zshrc # or ~/.bash_profile
Configuration Files
/usr/local/etc/nginx/nginx.conf/usr/local/etc/php/5.4/php.ini/usr/local/etc/nginx/fastcgi_params
Stop nginx with nginx -s stop, start with nginx, and reload config with nginx -s reload. Homebrew installs under /usr/local, so sudo shouldn't be needed when issuing those commands.
Percona steps from Wizard Mode. nginx and php-fpm steps from Matthew Holt.
More in Technical Deep Dives
001 2026.10.14
October 14, 2026
Your Agents Made You Faster. Your Customers Didn't Notice.
Agentic workflows made producing artifacts close to free, but the bottleneck moved to conversations with people who might pay. Inventory reads as progress while the constrained side of the system never sped up.
002 2026.09.30
September 30, 2026
I Mined My Session History for the Prompts I Actually Reuse
My vault had a 55-note prompt library. An audit of my own session transcripts found 5 prompts I'd re-typed enough to prove, 4 patterns worth promoting to skills, 2 skills worth demoting back to prompts, and about 40 imported templates I had never used once.
003 2026.09.02
September 2, 2026
Evaluate Your DevRel Program Like an Agentic Workflow
AI recommendation is a distribution channel that never reports back. I evaluate my DevRel program the same way I evaluate an agentic workflow, checking presence first, then accuracy, and auditing both on a cadence.