Sun
Jun 25
2006

Setting up WordPress on WinXP

Getting WordPress running on WinXP was surprisingly easy. Here are my notes on the install.

  • WinXP SP2
  • PHP 5.1
  • MySQL 5.0
  • WordPress 2.0

Installing PHP on IIS

  • Download and install the PHP Windows installer package. I used all the default options.
  • Grant IUSR_ write access to c:\php\sessiondata and c:\php\uploadtemp
  • Added index.php as a default document in IIS (IIS Admin -> Default Web Site -> Properties -> Documents tab -> Add… -> index.php
  • To test the install create a file named c:\inetpub\wwwroot\test.php with the contents
    [php]
    phpinfo();
    ?>
    [/php]and then use your browser to view the page at http://localhost/test.php
  • Open c:\windows\php.ini
    Uncomment the line extension=php_mysql.dll
    Change the extension_dir line to read: extension_dir = "./ext/"
    Save the file.
  • Download the PHP binaries (not the windows installer version).
    Extract libmysql.dll and ext/pgp_mysql.dll into c:\php and c:\php\ext

Installing MySql

  • Download and install MySQL. I used the complete version but in hindsight I probably only needed the essentials.
  • Download and install MySQL Administrator from the same site.

Create a WordPress database

  • In the Catalogs section, create a new schema named wordpress
  • In the User Administration section, create a user named wp_user, enter a password.
  • Right-click on the new user, Add Host From Which The User Can Connect, enter localhost.
  • Select localhost which should now appear under the new user on the left.
  • On the right-hand side, select the Schema Privileges tab, select the wordpress database.
  • Click the << button to assign this user full access to the wordpress database. Warning: Be sure to select the localhost node on the left when assigning privileges so the user only has permissions when connecting locally.

Setup WordPress

  • Download WordPress.
  • Extract to c:\inetpub\wwwroot\wordpress
  • In the new wordpress folder, rename wp-config-sample.php to wp-config.php.
  • Edit the file and change the database name, user name and password.
  • Open your browser to http://localhost/wordpress/wp-admin/install.php
  • Download themes and extensions.
  • I had to peform this fix before I was able to upload files.

Enable Permalinks in WordPress with IIS

  • Create a file wp-404-handler.php with the code
    [php]
    $my_wp_url = "http://" . $_SERVER['SERVER_NAME'] . "";
    $_SERVER['REQUEST_URI'] = substr($_SERVER['QUERY_STRING'], strpos($_SERVER['QUERY_STRING'], $my_wp_url)+strlen($my_wp_url));
    $_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
    include('index.php');
    ?>
    [/php]
    This code is from WordPress Permalinks on IIS. I have changed the code slightly (line 2) since I host my Wordpress installation in the root directory.

  • Configure IIS to redirect 404 errors to “/” (no quotes)
  • UrlScan, must be configured to allow periods in the URL. Open c:\windows\system32\inetsrv\urlscan\urlscan.ini. Change option to read AllowDotInPath=1
  • Turn on permalinks in the WordPress permalinks options
  • Restart IIS

Some other good articles on setting up WordPress, PHP, MySQL:
David Seah’s WIMP Notes
WordPress 5-minute install
Web Thang Installing PHP for IIS on Win XP
WordPress Permalinks on IIS
Easy Permalinks in IIS

1 Comment so far

  1. Sasha October 13th, 2008 7:19 pm

    Thank you so much for this post!!

    I was going nuts trying to work out why the wordpress install that I had on my local host wasn’t writing any dynamic pages and all that I needed to do was add index.php as a default document!!! That was so easy that I want to cry!

    Thank you again :)

Leave a reply

© 2009 Brian Low. All rights reserved.