WordPress on IIS

Author: Eric Woersching

Published on December 18, 2007 by iisteam

Updated on September 11, 2008 by iisteam

Average Rating  Rate It (0)

RSS

Introduction

WordPress is a popular blogging package. According to wordpress.org, it is "a state-of-the-art semantic personal publishing platform with a focus on aesthetics, web standards, and usability". The following sections describe how to install and configure WordPress for use with FastCGI on IIS 6.0. This document assumes that you have completed the setup and configuration of the FastCGI extension and PHP libraries as described in http://www.iis.net/fastcgi/phpon60.

The instructions have been tested and found to work in the following configurations:

  • Windows Server® 2003 operating system 
  • IIS 6.0
  • PHP 5.2.4
  • MySQL 5.0.45
  • WordPress 2.2.3

Notes on PHP Setup

WordPress does not require many modifications beyond the default configuration provided by PHP. From the base configuration file provided by PHP, you only need to modify the following lines in your php.ini configuration file to get WordPress working:

  • Define 'extension_dir' as 'c:\php\ext' (i.e., the location of your php extensions directory)
  • Uncomment 'extension=php_mysql.dll' in the extensions list to enable MySQL support

Download and Unzip WordPress

Find the the latest release of WordPress at http://wordpress.org/download/. The instructions in this document are based on version 2.2.3, but future versions are likely to be very similar as far as installation is concerned. After downloading the zip package, extract its contents to C:\Inetpub\wwwroot\wordpress or another directory of your choosing. You do not need to modify the permissions on the wordpress web directory, as the default permissions suffice.

Set Up the Database

Before starting the installation procedure for WordPress, create a database on your server. Also create a user and grant this user db ownership permission to the database.  Follow the instructions in the Setting Up a Database for a PHP Application on IIS article for a MySQL database.   This walkthrough uses the following database information:

  • Database Name: 'wordpress'
  • Database User: 'wordpress'
  • Account Password: 'wordpress'

Modify the WordPress Configuration File

You must now set up WordPress to connect to the database just established in the previous steps.

1. Navigate to the installation directory (c:\inetpub\wwwroot\wordpress) and rename the file 'wp-config-sample.php' to 'wp-config.php'.

2. Edit 'wp-config.php' with an editor and change the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST values as needed:


<?php

// ** MySQL settings ** //

define('DB_NAME', 'wordpress');    // The name of the database

define('DB_USER', 'wordpress');     // Your MySQL username

define('DB_PASSWORD', 'wordpress'); // ...and password

define('DB_HOST', '192.168.0.4');    // Change this to the IP address of your database

define('DB_CHARSET', 'utf8');

define('DB_COLLATE', '');

 

// You can have multiple installations in one database if you give each a unique prefix

$table_prefix  = 'wp_';   // Use only numbers, letters, and underscores.

 

// Change this to localize WordPress.  A corresponding MO file for the

// chosen language must be installed to wp-content/languages.

// For example, install de.mo to wp-content/languages and set WPLANG to 'de'

// to enable German language support.

define ('WPLANG', '');

 

/* That is all, stop editing. */

 

define('ABSPATH', dirname(__FILE__).'/');

require_once(ABSPATH.'wp-settings.php');

?>

Configure the Application

1. Begin the graphical WordPress installation procedure by pointing your browser at http://localhost/wordpress/wp-admin/install.php. 

2. Click 'First Step' to go to the next screen. If you do not see this screen and get an error message, make sure that your database settings are correct in the WordPress configuration file (wp-config.php).

 

3. On the next page pictured below, WordPress asks you for the name of your blog and your email address. Enter the information and continue to the next screen.

 

4. The procedure is complete. You see a screen similar to the following. Be sure to copy down the temporary password assigned to you for the administrator account before continuing.

 

5. Now that the installation is complete, point your browser to the following address to begin managing your blog: http://localhost/wordpress/wp-login.php.

 

The initial login page looks similar to the following screenshot:

 

Enabling "Pretty Permalinks"

Follow instructions in this article to enable "Pretty Permalinks" when hosting WordPress on IIS 7.0.  

Getting More Information

To discuss the FastCGI Extension for IIS 6.0, or file bug reports, please use the FastCGI forums:

To get more information regarding running various PHP applications on IIS, refer to:

Comments

  1. Submitted on May 03 2008 by
    martin.meixger
    When you want nice url's in your Blog ( as every SEO wants! ) it comes to some problems.
    Most PHP scripts - as wordpress too - exepts $_SERVER['REQUEST_URI'] to be the requested URL. But IIS / PHP doesnt serve this.
    A Workaround is adding a Line of PHP to every request by adding following to your php.ini:
    auto_prepend_file = C:\your_path\FIX_REQUEST_URI.php

    content of FIX_REQUEST_URI.php
    ? PHP
    $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
    ? >

    Read more ( in german ) on : http://martin.bz.it/post/2008/03/Url-Rewriting-PHP-und-IIS.aspx

  2. Submitted on Sep 05 2008 by
    ruslany
    The issue with REQUEST_URI server variable has been fixed in FastCGI, so it is not necessary to use any workarounds in wordpress when enabling SEO urls. Check out this blog post http://ruslany.net/2008/08/update-for-iis-70-fastcgi-module/ for more details.
  3. Submitted on Oct 09 2008 by
    ksingla
    I was getting the same error as many others got on IIS7 (http://wordpress.org/support/topic/202399) and the fix is to set enable_log to syslog in php.ini.
  4. Submitted on Dec 19 2008 by
    elBradford
    So, I have been trying this with Wordpress 2.7, PHP 5.2.8 and MySQL.. the latest version, whatever that is. Wordpress runs quite slowly, with FastCGI and no caching. Also, I can't access any pages or blog posts in wordpress, just the main index.php and the admin pages. Any chance this could be due to the new Wordpress version?

  5. Submitted on Dec 23 2008 by
    wally@nstsupport.com
    Me to installed everything work except everytime someone or even administartor try to commect in blog site it generate 500 server error.. any suggestion?
  6. Submitted on Dec 23 2008 by
    elBradford
    I've installed WP 2.5.1 and it seems to work, now trying to get pretty permalinks to work and it's having a bit of trouble, but at least accessing pages and blog posts works better, and it's much faster.
  7. Submitted on Jan 15 2009 by
    ruslany
    I've upgraded my blog: http://ruslany.net to WordPress 2.7 on IIS7 and it seems to work fine so far.

You must Log In to comment.