04 February 2010

How to Install PHP on MAC OS X Snow Leopard - The Easy Way

Installing PHP5 on Snow Leopard is easy. It's already there. The only thing is that most web sites say "uncomment" the line, but I didn't see the line at all.

You can make sure that the module is there before enabling it. Mine was in:

/usr/libexec/apache2/libphp5.so

So, I just added one line to:

/etc/apache2/httpd.conf

and that was:

LoadModule php5_module /usr/libexec/apache2/libphp5.so

then I restarted apache by typing:

sudo apachectl restart

If something is wrong, use the -t directive to troubleshoot.

sudo apachectl -t

I'll try and answer any questions you have if you post them here...