Skip to content

New Dev Environment Setup (by Joe)

willmot edited this page Dec 18, 2012 · 9 revisions

This will set you up with the following:

  • PHP-FPM
  • Nginx
  • MySQL
  • Memcached
  • WP-CLI

Install Brew

sudo /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
echo 'export PATH="$PATH:/usr/local/sbin"' >> ~/.bashrc ; source ~/.bashrc

(See https://github.com/mxcl/homebrew/wiki/installation for changes)

Install Xcode command line tools

Get these from apple dev center or install Xcode

Install Nginx

brew install nginx  
curl https://raw.github.com/gist/3039416/271cb98a5b0b5c1763e036f238c7822a22412957/php.conf > /usr/local/etc/nginx/php.conf
rm /usr/local/etc/nginx/nginx.conf
curl https://raw.github.com/gist/3061254/7bb96ef82879402258081ca8f58587e5e61cd461/nginx.conf > /usr/local/etc/nginx/nginx.conf

sudo nginx

Edit your nginx conf here: /usr/local/etc/nginx/nginx.conf

Install MySQL

brew install mysql
unset TEMDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
mysql.server start
/usr/local/bin/mysql_secure_installation

Install PHP

brew tap josegonzalez/homebrew-php
brew tap homebrew/dupes
brew install php53 --with-fpm --with-mysql
cp /usr/local/etc/php-fpm.conf.default /etc/php-fpm.conf
sed -i "s/user = nobody/user = $USER/g" /etc/php-fpm.conf
sed -i "s/group = nobody/group = $USER/g" /etc/php-fpm.conf
php-fpm

Install Memcached

brew install memcached
brew install php53-memcache
memcached -d

Install GIT

brew install git

Install WP-CLI

git clone --recursive git://github.com/wp-cli/wp-cli.git ~/bin/wp-cli
cd ~/bin/wp-cli
sudo utils/dev-build
Something went wrong with that request. Please try again.