Setting up MAMP on my new Mac
One of the first tasks when I got my new MacBook (13" Aluminum, non-Pro, OS X 10.5.7 Leopard, 4 Gb RAM), was to set up a local server so I can do some local web development and testing with Drupal. Now this is a little tricky on the Mac since it comes pre-installed with Apache and PHP (I couldn't find any MYSQL on the machine), although much of it is only accessible by using the Terminal window. My first thought was to just use that and add the MySQL into the mix. It was weird but everything I read online about this recommended not using what was on the machine, but compiling it yourself. So next I thought I would download them all separately and configure them to my liking. After thinking about this and then running it past my own everything web/database consultant (thanks Roger), I decided to just download MAMP. Since I had done this on my home machine before (iMac, late 2006, OS X 10.4.11 Tiger) I figured it would be easy. Well it was to install but I did run into a few glitches along the way.
I had a WAMP stack on my old Dell that I was working with (thank you easyWAMP) and I needed to get my Drupal sites over to the Mac. In the end it worked out, I just needed to figure out how to change the configuration settings for everything properly.
First, I went to the MAMP website and downloaded the latest for OS X. This puts the package in your applications folder. At first I thought this was kind of a weird spot for it, but it really helps keep it separated from the other web server files already on the machine.
To get phpMyAadmin working, I moved it out of the default location and dropped it into MAMP >> htdocs. This made it accessible by going to /yourlocalsite/phpMyAdmin. I could then set up the database that I was going to import into. I copied over the Drupal directory files from the Dell and also put them into htdocs. In Drupal, adjusted the sites/default/settings.php file to include the new database name and password. I changed the address to localhost:8889. This was an important step to get things working right. You can change this port number if you like in the MAMP preferences by launching the application from Finder.
At this point I thought that everything should be working. I was wrong. First, I followed the directions that I found here http://drupal.org/node/66187 to help set up the user on MAMP. I'm not sure if this is necessary since I made a couple of changes at once but I think it was. I got things working on a fresh install of Drupal, but it wouldn't work for my existing site, all I got was the white screen of death. I checked the logs for php at MAMP >> logs >> php_error.log and noticed I was running out of memory. I was skeptical, but I upped the memory limit to 32M in MAMP >> conf >> php5 >> php.ini. I stopped the servers and restarted and viola! it worked. This is a nice thing about MAMP, it puts all the config and log files together for you.
The other main hitch I ran into was not emptying the caches on the databases before I exported them from the Dell and importing them into the Mac. Make sure you do this by going into phpMyAdmin. Good luck in all your web pursuits!



