Setting up dev environment on OSX Mountain Lion

Databases: MYSQL and POSTGRES

brew install mysql

PHP 5.5 FPM

brew tap josegonzalez/php
brew tap homebrew/dupes
brew install php55 --with-fpm --with-homebrew-openssl
brew install php55-xdebug php55-imagick php55-mcrypt

Nginx

brew install nginx

# add alias to your rc
alias restart-nginx='sudo nginx -s stop; sudo nginx'

Now DNSMASQ

brew install dnsmasq
echo "address=/.dev.com/127.0.0.1" > $(brew --prefix)/etc/dnsmasq.conf

sudo cp -fv /usr/local/opt/dnsmasq/*.plist /Library/LaunchDaemons
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev.com'

# From now on anything at *.dev.com will be pointed at 127.0.0.1

Based on:

http://vanderveer.be/blog/2012/10/12/setting-up-my-perfect-developer-environment-on-osx-10-dot-8-mountain-lion-10-dot-8-2-final-edition/
http://echodittolabs.org/blog/2012/04/os-x-107-lion-development-nginx-php-mariadb-homebrew

1 thought on “Setting up dev environment on OSX Mountain Lion”

Leave a Reply