Script for Resetting a Locked MAMP

MAMP is an amazing tool. I use it almost every day to virtualize LAMP on my mac and do web design locally. This shaves an unbelievable amount of time off of making a new website, but it's not without quirks. Occasionally if it or OS X crashes, it usually ends up locked - displaying that the server is running when it is not. Even telling it to stop or restart doesn't do anything, it just keeps showing that it's running.

That was a huge pain and stop in productivity for me until I read this post by Aral Balkan. Aral says that there are a couple .pid files (/Applications/MAMP/Library/logs/httpd.pid and /Applications/MAMP/tmp/mysql/mysql.pid) that need to be deleted before MAMP will reset and be in a state that can be started again. GREAT! Now I can get back to work after a few minutes... but after that happens a few times it gets annoying.

To expedite my return to work I made a script that will automatically delete those files outlined by Aral. Feel free to download my MAMP unlock script if you think it will help, but be warned that it holds no guarantee, warranty, etc. and you use it at your own risk.

  1. Download MAMP Unlock Script (right click, then "save link as")
  2. Double click the script (you won't see a flash or change on the screen, but MAMP should say it's not running anymore).
  3. Start MAMP again.