Local Web Development With OS X 10.5 (Leopard)
With the release of Leopard last Friday, it appears the bulk of my previous tutorials are now taken care of out of the box. mod_rewrite is enabled by default, and a decent (but not robust) installation of PHP 5.2.4 is ready to go – it only needs to be uncommented in the Apache configuration file.
The PHP installation is missing some key extensions, like PostgreSQL support and the GD library to name a few. But the majority of commonly used extensions are ready to go. Marc Liyanage is already on the case and working out the kinks for his own installer including those additions. The only thing missing at this point is MySQL support for Leopard. As of this writing, there is no installer available yet.
The rest of this post assumes you are working from a clean install or an “archive and install” of 10.5. I’m not sure what the Apache configuration files may look like if you simply upgraded from 10.4 or 10.3 – if they are clean this should work just fine.
Open the Apache configuration file (I’m using TextMate, which is where the ‘mate’ command comes from):
$ mate /etc/apache2/httpd.conf
and scroll to line 114 – it should look like this:
#LoadModule php5_module libexec/apache2/libphp5.so
Just remove the comment:
LoadModule php5_module libexec/apache2/libphp5.so
To enable Virtual Hosts, uncomment line 461:
and add your own directories in your
/etc/apache2/users/you.conf file. Similar to the 10.4 configuration, change the first two lines (inside
<Directory "/Users...>) like so:
and add your Virtual Host directives after that:
$ sudo apachectl restart
and you’re all set.
The only thing left to do is update your hosts file:
$ mate /etc/hosts
and add whatever you used for your ServerName after the other entries:
Now I need to figure out if those rumors of Ruby on Rails out of the box are true…