Sunday, June 7, 2009

WordPress on the second attempt

Last November I tried to set up SweetCorn with MySQL on my home system. It wasn't a total success; in other words a total failure. After that, someone asked me about deploying WordPress, which also requires MySQL, and PHP to boot.

The Apache httpd server needed a couple tweaks. Part of the clue to get me moving was a suggestion in a NetBSD mailing list to build the drupal package first. That didn't give me everything I needed, but it helped.

Apache needed a PHP hint in the httpd.conf file:

> LoadModule php5_module lib/httpd/mod_php5.so

It also needed to be told to treat index.php equivalent to index.html:

> DirectoryIndex index.html index.php

Lastly, it needed an application type (I think):

> AddType application/x-httpd-php .php .php4 .php3

I copied the WordPress files beneath the Apache root, and had a little trouble with the permissions, as I should have created them with the web server ID instead of mine (and certainly not root).

Getting MYSQL running was easier on the second pass, particularly with a terse help message found on Big Mojo: http://www.bigmojo.net/monsters/?p=33

Or, as they called it:

> Wordpress and the dreaded “Your PHP installation appears to be missing the MySQL”

I learned that php.ini (on NetBSD: /usr/pkg/etc/php.ini) needed tweaking:

> extension=mysql.so

The directory for this is /usr/pkg/lib/php, and the drupal build should have dumped the mysql, gd and mod.so files here:

> /usr/pkg/lib/php/20040412/

If not found, the error messages can be daunting. Finally, after several hours of debugging and building, I had a working Wordpress install ("the 5-minute install"), and proceeded to bring up a blog space.

> WordPress has been installed. Were you expecting more steps? Sorry to disappoint.

The last piece to unwind (so far) was wrong permissions on the image upload directory, announced with this message:

> Unable to create directory /home/pkg/share/httpd/htdocs/wp-content/uploads/2009/06. Is its parent directory writable by the server?

Fairly self-explanatory, including the fix, which is an improvement from the majority of error messages that say something like "if you see this message, that's bad."

Replicating the install behind the firewall at work was a lot quicker than the home server test, so now I have 2 installs. Just in time for the 2.8 upgrade available this week!

No comments: