[Updated on Jan 14, 2014]

This is the quick and dirty version to setting up a MAMP stack on your Mac for local development.

This process has been similar for every major OSX releases since at least Leopard, and has worked for me on Leopard, Snow Leopard, Lion, Mountain Lion and Mavericks.

If you want the extended version with all the nice explanations of why things are the way they are, please visit MAMP (Mac Apache MySQL PHP) Without the MAMP App.

Configuring Apache

Open /etc/apache2/httpd.conf and make the following changes. Note that these pieces of code are not actually right next to each other.

# first thing to do is enable PHP by  
# uncommenting this line (remove '#' at the start of the line):  
LoadModule php5_module libexec/apache2/libphp5.so

# uncomment this line so that it will include our virtual-  
# hosts config file (which we will edit later):  
Include /etc/apache2/extra/httpd-vhosts.conf

# change DocumentRoot "/Library/WebServer/Documents" to  
# reflect the path you want your Document Root to be at  
# for example:  
DocumentRoot "/Users/cameron/Sites/"

# a few lines after that, find  
# <Directory "/Library/WebServer/Documents">  
# and change it to be the same as your doc root:  
<Directory "/Users/cameron/Sites">

# in that <Directory> node enable AllowOverride  
# so that .htaccess files will work on individual sites  
AllowOverride All  

Setting Up Virtual Hosts

Now open /etc/apache2/extra/httpd-vhosts.conf. This file only really needs two lines. Make sure to use the same path you set up as your Directory Root in the step before (with the addition of the %0 at the end).

For example:

UseCanonicalName Off  
VirtualDocumentRoot /Users/cameron/Sites/%0  

Open /etc/hosts (this file has no extensions).

Add an entry for a local domain you want to use. (Don't use .local!)

For example, add this line to the end of your hosts file:

# 127.0.0.1 is a special IP that will  
# always point to your local machine  
127.0.0.1 website.test  

Enable Apache by checking System Preferences > Sharing > Web Sharing.

Apple has removed the Web Sharing option. To restart apache, run this command from the terminal:

sudo apachectl -k graceful

Create a folder (i.e. website.test) in your Doc Root. You have to have a matching entry in your hosts file for this to work. Create an index.php file in that directory and have some simple PHP code in there. Visit that page (i.e. http://website.test) to make sure it's working.

Installing MySQL

The Homebrew way:

brew install mysql

Manual Download:

Go to http://dev.mysql.com/downloads/mysql/ and download the appropriate version (it may not have a version for the most recent version of OSX, but the most up-to-date one will work fine). You have to create an account. Once that's installed (there is a panel in your System Preferences), make sure it's enabled.

Fin.

That's all there is to it!

You should have the full MAMP stack working with Virtual Hosts. Just add a folder to your Doc Root and an entry in your hosts file and you have a new site.

If you need more details, please visit the extended version of this guide: MAMP (Mac Apache MySQL PHP) Without the MAMP App.