-- Drupal and Web Development

Notice: this post was last updated 5 years 14 weeks ago so it might be outdated. Please be cautious before implementing any of suggestions herein.

Installing / debugging MAMP on Mac OS X

MAMP is a local server with MySql and PHP on your Mac. It is great to run local copies of Drupal, Wordpress, etc. on your computer. Here's how to install it.

I reinstall MAMP every time I update Mac OS X (say, from 10.6.6 to 10.6.7). The reason is that updating Mac OS X results in MySQL Server refusing to start (i.e. I get the red light next the Mamp Server), and after hours of searching, I can't figure out why. Reinstalling MAMP every time is easier for me.

So let's go ahead and install MAMP:

(1) If you have a previous version of mamp, move your /Applications/MAMP/db, /Applications/MAMP/htdocs folders, /Applications/MAMP/bin/php/php*/conf/php.ini and your /Applications/MAMP/conf/apache/httpd.conf file to the desktop, quit MAMP, and delete /Applications/MAMP.

(2) Downdload MAMP at, and install it in your Applications folder. (There is a nice installer that does this for you, just use the defaults).

(3) Move your old databases, sites, php.ini and httpd.conf back to their position in /Applications/MAMP. Make sure you keep the files that already in your new install. Just move your databases and files, nothing else.

(4) Make sure there are entries in /etc/hosts for every local domain name you use. For example, Drupal installations in subfolders breaks some functionalities, so mysite.local is better than localhost/mysite. In this case there should be a line in /etc/hosts that says " mysite.local". There must also be corresponding entries in MAMP's httd.conf file, like this:

NameVirtualHost *
<VirtualHost *>
ServerName localhost
DocumentRoot /Applications/MAMP/htdocs
<VirtualHost *>
ServerName mysite.local
DocumentRoot /Applications/MAMP/htdocs/mysite

(5) In your terminal, type "sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock; sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock". This creates a symbolic link to the real location of the mysql "socket" (used by any site/program that uses MySQL), from one of the locations where they expect it be.

(6) Still in the terminal, type in "mv httpd.conf httpd.conf.bak; sudo ln -s /Applications/MAMP/conf/apache/httpd.conf /etc/apache2/httpd.conf". This tells your mac that your local server is managed by MAMP.

(6a) Make sure, in /Applications/MAMP/bin/php/php*/conf/php.ini, that memory_limit is high, max_execution_time and max_input_time also.

(7) Fire up MAMP, and both servers should be green. Try two or three times if both green lights don't light up. If MySQL server refuses to turn green (now or any time in the future), open the Acitivty Monitor application of your mac, find all mysqld processes, and force quit them. Try again to launch MySQL server and it should work.

You're done!