My First Blog and How To Install WordPress

October 18th, 2008 by jason Leave a reply »

Well how special am I?  I had two paragraphs of my first blog post written and after changing to full screen mode, I lost everything I had typed!  And I was just about to comment how impressed I am with WordPress.  I still am but I just learned my first valuable lesson with this web based application.  I am actually blown away by the flexibility and number of versatile configuration screens the admin console has.  I am proof that with WordPress, anyone can have a professional looking blog, irregardless of content.  Now I just need to find a decent theme so my blog isn’t mistaken for RTFM Education.

So actually this isn’t quite my first ever blog post.  My first blog post was written several months ago on a different platform when I had five minutes to kill.  I also write family news once in a while on my boche.net site to keep our relatives up to date on current events around our house.

Before installing WordPress, I had a few thoughts on what my first blog post should be.  Helpful and insightful to the reader.  As I struggled for a few hours getting WordPress to work, I knew I had a topic in the making:  How To Install WordPress.  Well, not so much how to install and configure WordPress, but rather how to install and configure the prerequisite platform components so that WordPress works correctly.  Hopefully someone is able to follow the steps I did without wasting hours troubleshooting PHP, IIS, and directory permissions.  By the way, this is on Windows Server 2003.  The error message I was struggling when trying to use WordPress was “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”.  Here are the steps I followed to get WordPress up and running successfully:

  1. You need a web server.  Install Windows Server 2003 and Internet Information Services 6 (IIS).  Windows Server 2008 and IIS 7 may work also, but that platform introduces some significant differences which I don’t have the tested steps for.  Create your new website in IIS Manager, or use the default website.
  2. Install MySQL 5.0.67.  I used the MSI installer (file name is mysql-essential-5.0.67-win32.msi).  Don’t use the .zip file.  Choose an installation drive letter that’s going to provide enough disk space for your WordPress database and any other MySQL databases you might want down the road.
  3. Create your WordPress database by using the MySQL Command Line Client from the Start Menu.  The command is CREATE DATABASE wordpress;   Don’t forget the trailing semi-colon.
  4. Install the MySQL Administrator which you can download from the MySQL website.  File name is mysql-gui-tools-5.0-r13-win32.msi.  Use MySQL Administrator to create a WordPress user account that will be used by WordPress to manage the WordPress database in MySQL.  When creating the user account, grant all MySQL roles for the user on the WordPress database.
  5. Install PHP 5.2.6 using the MSI installer (not the .zip file).  File name is php-5.2.6-win32-installer.msi.�
    1. Perform a custom install. 
    2. Web Server Setup:  IIS ISAPI module
    3. Important:  Choose two extensions to install:  MySQL and MySQLi
  6. The installer will perform several key configurations for you:
    1. Adds your PHP installation directory to your PATH statement allowing your server to find the file libmysql.dll
    2. Places the two extension .DLLs in the \ext\ directory which PHP based WordPress needs
    3. Modifies the php.ini file to activate the two extension .DLLs
    4. Creates a PHP Web Service Extension in IIS and sets to Allow
    5. Adds the .PHP application extension and appropriate verbs to IIS
    6. Creates the environment variable PHPRC=(path to your PHP directory)
  7. Next step, set the correct NTFS permissions on your PHP directory.  Allow subfolders and files to inherit.
    1. Internet Guest Account (IUSR_servername) = Read & Execute
    2. NETWORK SERVICE = Read & Execute
  8. Install WordPress 2.6.2 by unzipping the folder contents into the appropriate IIS directory structure for the website defined in step 1 above.
  9. Set the correct NTFS permissions on your WordPress installation directory.  Allow subfolders and files to inherit.
    1. Internet Guest Account (IUSR_servername) = Modify
    2. NETWORK SERVICE = Modify
  10. In IIS Manager, modify the properties of your website.  Documents tab.  Enable default content page:  Add:  index.php
  11. Restart the World Wide Web Publishing service
  12. You’re ready to install and configure WordPress.  Follow the instructions at http://codex.wordpress.org/Installing_WordPress

Using the PHP MSI installer with the appropriate options is the best use of your time.  Many Google internet searches on the error message above will have you performing steps that may or may not resolve your issues if you choose to install PHP manually.  None of the home brew solutions worked for me and resulted in a waste of time:

  1. Modifying the php.ini, changing the path for extension_dir=
  2. Modifying the php.ini, tweaking values for extension=
  3. Copying the file libmysql.dll to %systemroot%\system32\
  4. Adding and modifying environment variables
  5. Rebooting your web server

Special thanks to Michael Sharman and his website who ultimately pointed me in the direction of re-looking at the PHP MSI installer where I had missed the steps of adding the two MySQL extensions.

By the way, after struggling for a while on my production web server and not wanting to muck it up while spinning my wheels, I called on the assistance of a vanilla VMware virtual machine running Windows Server 2003 to successfully test my new installation steps (taking snapshots along the way).  VMware virtualization helps save the day (again).

Advertisement

No comments

  1. Directory says:

    Very informative article, which I found quite useful. Cheers ,Jay

  2. Very interesting. My brother had to help me set up my wordpress, but after i started experimenting with it i found it very easy to use. Keep up the good work.

  3. Kris P. says:

    Thank you for this post! It was very useful for me and got me up and running on WordPress quickly, after an hour or two of fighting problems.

  4. Sean Kassay says:

    Very Good post dude Thank you