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:
- Download MAMP
- Drag MAMP to Applications folder.
- Launch MAMP app
- Click “Preferences” button
- Go to “Ports” tab and click “Set to default Apache MySQL ports”
- 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.