Enable PHP on Mac OSX 10.5

Yes, I've got a new job (details will be forthcoming), but in the mean time I've got a shiny new Macbook (black, naturally) running Leopard.

As part of setting it up I wanted to run some of my web pages locally and realised that PHP wasn't enabled out of the box. Luckily it is really easy to set up. Just sign in to a terminal session as a user with admin privileges and;

$ sudo vi /etc/apache2/httpd.conf

and then uncomment line 114, which starts out looking like this;

#LoadModule php5_module       libexec/apache2/libphp5.so

Then restart Apache by de- and then re-selecting 'Web Sharing' under the 'Sharing' pane of System Preferences. You don't need to do anything else because the nice people at Apple thoughtfully provide an appropriate configuration file that is included when you enable the PHP module.