You are hereForums / Computers / CentOS server setup and maintenance notes / Installing WordPress

Installing WordPress


By admin - Posted on 08 September 2008

What better subject to blog about as my first real posting than installing WordPress as my blog software? Obviously, I didn't get the "legendary five minute install" or there wouldn't be anything to write about. Actually there were only two problems but they still took the better part of a day to resolve.

The first problem was the dreaded "missing MySQL" message on attempting to open wp-admin/install.php. This message struck me as odd since I have had MySQL installed and running on my server for several years. MySQL is the database engine for my spam filter dSPAM which gets a workout everyday. MySQL was definitely avail;able.

I then checked as best I could that MySQL was accessible and the account specified for WordPress worked. Again no problems so I went to Google and started Googling. About all I can say at this point is this error seems to occur fairly frequently and has several different causes since quite a few people sem to have posted on various forums looking for an answer. The one that finally got me on the trail of the actual problem was someone mentioned to check to see if mysql.so was correctly configured in /etc/php.ini. I checked and in /etc/php.d and there was no sign of it so I manually added a reference to it in php.ini. Big mistake.

php didn't like that at all so then I checked to see if mysql.so was present. Sure enough, it wasn't so back to Google. Google told me I needed to install php-mysql so I did a "yum install php-mysql". I then did a php -v and got a raft of error messages about duplicate definitions for a bunch of MySQL related functions. I eventually tracked this down to my manual edit of /etc/php.ini since installing the php-mysql rpm added the required references in a file in /etc/php.d.

WordPress still didn't work but at least the symptoms had changed. I now got a browser error response saying that my browser wouldn't let WordPress set a cookie. Back to Google. This had to be the one of the most bizarre errors I have ever run into. Everything appeared to be working except being able to access the admin account or any other login. The ultimate cause was I had a blank line at the beginning of wp-config.php. I deleted the blank line and now I'm up and running.

Observations:

The MySQL error is probably pretty typical when someone like me mixes tar.gz distributed programs with an RPM based system. Had there been an RPM for WordPress, the dependencies would probably have been coded correctly and the RPM would have wanted both a MySQL database and the php-mysql package. As it was, I only checked that I had an acceptable version of MySQL installed and proceeded to flail. SIGH.

Update: It turns out that there was one more problem lurking with my WordPress installation. It seems that SELinux didn't like WordPress sending out e-mails. This problem was really just still more fall-out from not having an RPM for installing WordPress since CentOS/RHEL RPMs are supposed to include any required tweaks to the SELinux rules. audit2allow gave me a good guess at the requisite rule tweaks so, hopefully, this is fixed now.

Update 2: I now have a custom background for my blog header. The trick is to create a 760x200 image and save it in /var/www/fraud/html/wordpress/wp-content/themes/default/images as kubrickheader.jpg. Oddly, the original image is 760x200 which is the same size as the image I created but my image sticks out a little on either side. I'll tweak it when it annoys me enough to do something about it.

Cheers,
Dave