I've found myself down a rabbit hole and would like advice. It looks like Mac OS X 10.5.8 comes bundled with a pre-configured version of Apache 2.2.11 (located in /usr/sbin), PHP 5.2.10 (located in /usr/bin) and subversion 1.4.4 (located in /usr/bin). I have installed MAMP for MySQL 5.0.41 (located in /Applications/MAMP/...) which comes with Apache 2.0.59 and PHP 5.2.6. The current version of MySQL is 5.1 (mysql.com). I have also installed the latest Subversion binaries 1.6.5 (they get located in /opt/subversion/...). This is becoming a mess. Ideally I would like to have one copy each of Apache, PHP, MySQL, and Subversion and have them all be the latest release and have them work together properly. Are there configuration pitfalls specific to the Mac that I need to watch for if I install the newest binaries of Apache in /usr/sbin, PHP5 in /usr/bin, subversion in /usr/bin, and Mysql in /usr/bin (or /usr/local/bin)? Am I just asking for trouble?
Do not install ANYTHING in /usr/bin or /usr/sbin. Those are managed by Apple and you can get yourself and your system in trouble when you start modifying stuff there. Other than a bit of wasted disk space, there's normally no problem with having more than one copy of things like Apache. Just accept it.
If you need newer or missing versions of open source packages, you might want to look into using MacPorts or Fink to supplement what's provided by Apple.
My personal preference is just not to do this development on my Mac at all, and instead run a Linux Virtual Machine using VMWare Fusion, VirtualBox or similar. One of thes nice things about VMWare Fusion 2 (not 3 though, bizarrely) is that you can run these virtual machines in headless mode, and simply SSH into them via terminal on your Mac.
The benefit to me here is that my VMs are able to very closely mirror the setup of my production machines, I'm able to closely control what software is actually installed on them, and if I need to work on a new machine I can simply copy the VM from one machine to another. I can also easily take snapshots of the VM at any point, and roll back to them if I do manage to muck something up.
Here's a good guide to using VMWare Fusion for doing development on OSX.
I have been developing for the LAMP stack on a Mac for bit over 4 years now. I have tried pretty much every flavor of the stack on the Mac.
- Native: Not viable, because it's an old codebase.
- MacPorts: I ran into trouble with OS X updates.
- Self Compiled: Same as with the MacPorts, I ran into trouble with OS X updates.
- MAMPP: I didn't like this package, yet this is a personal dislike. I kind of disliked it's freemium like style. The package is not easily configurable, except using the commercial configuration software.
- XAMPP: I ended up sticking with XAMPP.
About XAMPP:
The XAMPP code base is rather up to date. With the Developer Package, you get all the tools necessary to compile additional extensions. Everything is configured in /Applications/XAMPP/etc/
.