Apache, PHP and MySQL on Snow Leopard

I have enjoyed using MacPorts for a number of reasons, and I have written about it several times. Recently, I have had to rely on it more, and I have grown frustrated with it to the point that I had to abandon it altogether.

I upgraded to Snow Leopard (10.6) last week. It broke my install of MacPorts, but they actually tell you to reinstall after an OS upgrade like this. So I did that, but I could not get Apache 2 and PHP running again to save my life, not to mention MySQL.

So I instead relied on the factory installs of Apache and PHP. It turns out they have gotten a lot better with Snow Leopard. All I had to do was reinstall MySQL which meant I lost my databases but I was prepared for that to happen by then anyway.

Here are the instructions to get Apache, PHP and MySQL running in Snow Leopard.

Install Apache/PHP/MySQL on Snow Leopard

It worked perfectly for me except for one thing. PHP short tags are off by default. So make sure to turn them on or check your code to make sure you are not using PHP short tags, or your PHP code will not work.

I may continue to use MacPorts for other things, but for now I am no longer using it for my dev environment. Maybe one day I will give it another shot if I need it.