I’ve been doing a lot of my web development lately on my macbook pro, but the problem is that I do the work locally, then have to rsync it to my Linux-based server to see the results. Not a huge deal, but a PITA. So I decided I was going to look into running the “stack” on my mbp directly, so I could do all the development locally… great for when I’m at the in-law’s place without a direct internet connection.
I’ve been reading about MAMP and XAMPP, both are providers of the “stack” for OS X (XAMPP actually also works on Linux and Windows too). I chose MAMP because it has a more recent version of PHP available (5.1.6 vs. 5.0.5 in XAMPP). I’m hoping they’ll update soon to 5.2.0 since that’s what my webserver will be running in a few months.
The problem with MAMP, however, is that you have to run the stupid MAMP application to actually start the apache and mysql daemons; it doesn’t provide support to have them started on their own at system startup. This thread on the MAMP forum gives you some clues, but not enough. For one, they set it up as an “on-demand” thing, triggered by a user login. This is fine for a desktop machine I suppose, but not so good for someone, say, running an Xserve and using MAMP as their production “stack”. So I took the info, did some fiddling, and got it to start at boot. Unfortunately, when you install MAMP (as a user), some ownership of files go to you that can’t go to you if you want it to start as a system service. You’ll need to add two plists to /Library/LaunchDaemons (I’ll get to that in a moment), and you’ll also have to change some ownership of files. The first thing to do is:
$ sudo chown -R mysql:admin /Applications/MAMP/db/mysql $ sudo chown -R mysql:admin /Applications/MAMP/tmp/mysql
The first is to grant ownership of the database files to user mysql (which is what the database will run as instead of, say, user joe (aka YOU)), and the second is to give user mysql write permissions to the temporary file directory where mysql wants to create it’s socket file (so as to communicate locally).
The plists you need are:
The second assumes you’ll be running mysql on the standard mysql port (and not the wierd non-standard port they use by default). Reboot and you’re good to go (make sure those plist files are owned root:admin).
That was one good thing… don’t even get my started on the new Zend Studio 5.5 beta that is “supposedly” a universal binary (hello… we need universal libs too people!)