WordPress setup

The person who claimed the “famous 5 minutes installation” must be joking, or intentionally limit the estimated effort. I spent about two days and two nights in order to getting the complete system up and running. The scope of the 5 minutes work is just a very small portion of the entire system setup.

The system I have set up includes: Apache, PHP, MySQL. I did it on a Windows XP, then Windows NT4.0, and then moved MySQL to a Linux. I encountered a series of issue along the way, and would like to list them here, so to help people who are going to take the same ride.

1. Install Apache
I installed Apache v2.0.50 on Windows XP and Windows NT4.0. After installation, make a web request to make sure the Apache webserver is up and running.

2. PHP installation and Apache configuration for PHP
Installed PHP v5.1.1. It is for the purpose of server side PHP scripting and execution, so you need to configure the Apache to enable it for handling of .php files. So add these lines to Apache configuration file - httpd.conf:

# For PHP 5 do something like this:
LoadModule php5_module “c:/php/php5apache2.dll”
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir “C:/php”

To verify that PHP is enabled, you can write a simple file, say, “phpinfo.php” with one line of code:
< ?php phpinfo();?>
Then put the file under htdocs directory and bring it up in web browser. If you see the a table showing PHP software information, you are good with PHP installation and configuration.

3. MySQL installation and configuration
I installed MySQL v5.0.17 on Windows XP. It is staightforward, and you can easily verify the installation by going to the database “mysql -u -p” and then “show databases;”.

Now you need to configure PHP to recognize and utilize the MySQL, because PHP script is calling to MySQL database access. Edit PHP configuration file: c:\php\php.ini:
a. uncomment extension=php_mysql.dll
b. set extension_dir = “C:\php\ext”
c. set doc_root = “C:\Program Files\Apache Group\Apache2\htdocs”
Also you will need to put “c:\php” in the System Path.

We don’t know if the MySQL configuration works or not right now, we will check it in next step.

4. WordPress installation
Unzip the WordPress v1.5.2 download to Apache docroot “htdocs”. Copy wp-config-sample.php to wp-config.php and modify the “define DB*” section to point to your MySQL instance.

Now request the “index.php” within your webbrower, and you will get error message:

Your PHP installation appears to be missing the MySQL which is required for WordPress.

Alas, the MySQL is not recognized.

I spent about 5 hours to look for a clue from Internet and play around the PHP configuration, and finally the trick is that you need to put “libmysql.dll” into Apache bin directory.

Now I can request “/wp-admin/install.php” to create the database table. And I can login to WordPress do most of Administration tasks. But I just could not save or post messages!
After one day of research, and I am so frustrated to the point that I just want to throw away WordPress and go for another software. I finally got some hints that one should remove STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION from the sql_mode for MySQL v5.0.*. Well I am so sick of tweaking this whole thing again, I just removed v5.0.17 and installed MySQL v4.1.16, and everything started to work.

I want to use an existing MySQL v3. on my Linux box. As I pointed that instance, it got error messages: ERROR 1045 (00000): Access denied for user: ‘[remote_user]@[remote_host]’

I executed

grant all on [databasename].* to [remote_user]@[remote_host] identified by [remote_passwd]

inside MySQL instance on Linux, and it started connecting to it and working now.

P.S. I also noticed that the client program “mysql” compatibility issue. The client “mysql” v3.* can not connect to MySQL v4.* server, but “mysql” v4.* can connect to MySQL v3.* server.

Smile now :) This site is running with all the components described above.

Leave a Comment

You must be logged in to post a comment.