WordPress.org

Codex

User:ringmaster/IIS

This article is a ROUGH DRAFT. The author is still working on this document, so please do not edit this without the author's permission. The content within this article may not yet be verified or valid. This information is subject to change.

Installation Issues on Microsoft Internet Information Server (IIS)

Windows-based servers are capable of hosting WordPress sites. The following issues are common during WordPress installation on IIS.

Contents

General Installation Issues

Windows servers don't come with many of the prerequisites for WordPress preinstalled. You will need to obtain this software to install on the server yourself.

Installing PHP

PHP is available as a free download for Windows directly from the PHP download page. It is most convenient to download the "installer" version of the latest PHP binary and run the installer on the server. Doing so will save you the trouble of configuring IIS to use PHP.

Be sure you download the binary installation version for Windows in the 4.x series, not the 5.x series. WordPress is not yet tested on PHP 5.0.


Installing MySQL

MySQL is available as a free download for Windows directly from the MySQL download page. It is most convenient to download the "installer" version of the latest MySQL binary and run the installer on the server. Doing so will save you the trouble of manually configuring MySQL services to start up with the server.


Configuring Permalinks

One of the more challenging issues during installation of WordPress on IIS is configuring search engine friendly permalinks. Using search engine friendly permalinks will cause WordPress to produce readable URIs for posts. Instead of links like this:

http://www.example.com/index.php?p=1&page=2

WordPress will form links like this:

http://www.example.com/index.php/hello-world/2/

To accomplish this in IIS, you must make some changes to your WordPress configuration, and ensure that certain settings are correct on your server. Following these steps will help eliminate the "No input file specified." error that occurs when PHP is improperly configured on the server.

First, you must ensure that PHP is configured correctly to allow post information to pass through to WordPress via the URI. The setting that you must set is located in your server's configuration file for PHP, php.ini.

If you are hosting your site on a shared server, you may not have permission to modify php.ini. In this case, you should request that your host "turn on the cgi.fix_pathinfo option for PHP", and refer them to this reference.

To make the appropriate edits to your php.ini file yourself:

  1. Open your server's php.ini for editing, which is usually located in the system path, often in the root Windows directory. Editing this file is often accomplished through a remote desktop connection, but you should use whatever method is easiest for you to edit this file.
  2. Search in the file for a line that contains "cgi.fix_pathinfo". This line will usually also conatin a value, such as "cgi.fix_pathinfo = 0".
  3. If you find this line, remove any semicolon that might prefix the line, so that the "c" is the first character, and change the value to 1, so that the complete line reads: cgi.fix_pathinfo = 1
  4. If the line does not already exist, add it to the file. You should add the line near the end of the [PHP] section of the file - after the text "[PHP]" but before any other line enclosed in brackets.
  5. Save the file on the server.
  6. If you are running PHP as an ISAPI extension (rather than CGI), you may need to restart the W3C service on your server for the changes to take effect.

After you have ensured that PHP is properly configured, you will need to tell WordPress to use friendly URIs. To configure a friendly permalink structure in WordPress:

  1. Log in to the WordPress administration panel.
  2. Access the Options > Permalink settings.
  3. In the Structure field, provide the Permalink Structure you desire, and be sure that your setting begins with "/index.php/".
  4. In the Category Base field, provide the Permalink Structure you desire, and be sure that your setting begins with "/index.php/".
  5. Click Update Permalink Structure.

Alternate Rewrite Methods

Currently, the PATH_INFO method mentioned above is the most reliable way of serving friendly URIs from WordPress using IIS. Another ways to configure WordPress to use friendly URIs is to use a mod_rewrite replacement.

Commercial products exist to fill this niche, including IIS Mod-Rewrite and ISAPI_Rewrite. Be aware that ISAPI_Rewrite, while functional, is not fully mod_rewrite compatible, and none of the automated mod_rewrite features of WordPress will work. You will need to code all of your rewrite rules by hand. On the other hand, IIS Mod-Rewrite is fully compatible with mod_rewrite and also it has a version that supports .htaccess. Almost every mod_rewrite rule set for wordpress will work with IIS Mod-Rewrite without any modification.

Products that enable rewriting on IIS (most are commercial):

Another method of emulating the mod_rewrite functionality exists using 404 (page not found) redirects. It requires that your web host allow you to use 404 redirects that use URLs instead of simply a page file, but most hosts do that.

The installation instructions and downloads are located here:

Thoughts on other topics

  • Virtual Hosting
  • The Management Console
  • Alternate FTP server for IIS?


AllowPathInfoForScriptMappings

http://blog.bluecrescenttech.com/archives/2004/07/29/my-email-notification-plugin-experience/

http://support.microsoft.com/kb/q184320/

Delphi Project for IIS mod_rewrite possibility: http://www.avdf.com/aug98/art_ot001.html