WordPress on IIS

Author: Eric Woersching

Published on December 18, 2007 by iisteam

Updated on December 18, 2007 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:

 

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

You must Log In to comment.

Page view counter