Simple MAMP setup

Since I switched back to Mac two years ago, I’ve been using Marc Liyanage’s PHP build for Mac to run my local dev environment. I never got all rewrites to work correctly on my local setup, which meant I could only do limited local testing for one site. A few weeks ago, after reading a series of php framework articles by Bart McLeod in php|architect, April-June 2008, I decided to give Zend Framework a try and set up a new site using it. However with my old dev environment, I could not even get the simple Quickstart app on the ZF site to work. So I went in search of another solution and decided to try MAMP and MAMP PRO. MAMP PRO hung on the MySQL start up, but I got a simple test environment set up with the free version of MAMP. It works with ZF, just need to change the rewrite rule from /index.php to index.php, and I was quickly able to get rewrites to work for the other site I mentioned. (Note: my quick fix of removing the leading slash would cause problems with urls in a subdirectory structure. Setting up virtual hosts should solve that.)

Here are the steps I used:

  1. Download MAMP
  2. Drag MAMP to Applications folder.
  3. Launch MAMP app
  4. Click “Preferences” button
  5. Go to “Ports” tab and click “Set to default Apache MySQL ports”
  6. In “Apache” tab change “Document Root” to /Users/[username]/Sites

Access your sites at http://localhost/[foldername]

There is a lot more you can do to customize MAMP; see the living-e forum and Supercharge Your MAMP Environment for some examples. In the meantime, the above should get you up and running within five minutes of completing the MAMP download.

Leave a Reply