Erik A. Hanson's Weblog

WordPress 2.7 Theme Development on Mac OS X 10.5 (Leopard)

Posted: December 17th, 2008    Tags: Howto

I wanted to create/edit a WordPress theme on my local computer, so I had to install WordPress. It wasn’t quite as straightforward as I would have hoped. Here are some instructions:

MySQL

I had already downloaded and installed MySQL, so I didn’t have to do anything. If I remember, installing MySQL was straightforward.

Apache

Apache comes pre-installed on Mac OS X, but I had to turn it on in System Preferences > Sharing > Web Sharing.

PHP

PHP 5 comes pre-installed on Mac OS X, but I had to enable it in Apache by editing the conf file:

sudo vi /etc/apache2/httpd.conf

and uncommenting the line:

LoadModule php5_module

WordPress

I downloaded WordPress and extracted it into:

~/Sites/wordpress

I followed the installation instructions, but I had to use “Localhost” instead of “localhost” as my database host name.

I created a symlink from the directory where I was editing my theme to the WordPress themes directory:

ln -s ~/Development/my-theme ~/Sites/wordpress/wp-content/themes/my-theme

Apache wasn’t set up to follow symlinks in my user directory, so I had to edit my personal conf file:

sudo vi /private/etc/apache2/users/ehanson.conf

and set the options line to:

Options Indexes MultiViews FollowSymLinks

Then I logged into the WordPress admin console at http://localhost/~ehanson/wordpress/wp-admin, set the theme to my new theme, and everything worked.



Leave a Reply



(Comments are moderated to keep out spam. Please be patient.)