Archive for August, 2008

Update for IIS 7.0 FastCGI module

IIS team has recently released an update for IIS 7.0 FastCGI module that fixes compatibility problems with several popular PHP applications. In particular, the update changes the behavior of FastCGI module in the following ways:

  1. REQUEST_URI server variable set by FastCGI module now includes query string and path info. Previously, lack of the query string in this server variable caused the popular CMS application Drupal to not work with FastCGI on IIS 7.0
  2. REQUEST_URI server variable now contains the originally requested URL path before any URL rewriting was performed. Prior to this fix, the server variable used to contain a final rewritten URL, which caused problems when using URL rewriting to enable “pretty permalinks” for popular blog engine WordPress.

Note that above mentioned problems do not exist in IIS 6.0 FastCGI Extension, which always has been setting the REQUEST_URI server variable correctly.

The update is available for download from the following locations:

Warning: if your PHP application was coded in a way so that it relied on the REQUEST_URI server variable to contain the requested URL without a query string or to contain the final rewritten URL, then installing this update may break your application. Before applying the update, please make sure that your application does not rely on incorrect behavior of FastCGI module.

Acknowledgements: I want to thank IIS team members (Anil Ruia, Won Yoo, Yamini Jagadeesan) for providing this update and Zend Technologies team (Stanislav Malyshev) for validating the changes in FastCGI module.

20 Comments »

ruslany on August 26th 2008 in FastCGI, PHP, WordPress

34,357 views

PoorFairAverageGoodExcellent (6 votes, average: 4.50 out of 5)

Ruby on Rails in IIS 7.0 with URL Rewriter

This article is very out of date at this point and most probably the instructions given here do not work. Please refer to more up-to-date and supported solutions for running Ruby on Rails in IIS 7 provided by Helicon Zoo Web Framework Repository.

If you ever tried to set up Ruby on Rails (RoR) on IIS 7.0 with FastCGI you have probably noticed that the process is not very straightforward. There are a few workarounds that need to be applied in order for RoR to function correctly. In particular, handling of static files in your web application can be tricky on IIS 7.0. The problem is that RoR uses clean URL’s that look similar to this: http://mysite.com/home/about. In order for RoR to be invoked for this kind of URL’s  it is necessary to create a “catch all” handler mapping in IIS (that is a handler mapping with path attribute set to “*“). When you create such a handler mapping it will cause requests for static files to be routed to RoR, which will obviously fail to handle them.

For RoR to work correctly on IIS with FastCGI it needs to behave like a 404 handler, meaning that it should be invoked only if the requested URL does not exist as a file on a physical file system. The default IIS configuration does not allow this kind of configuration, so there are several workarounds available today – this article describes them in great details. However, these workarounds are either not recommended for production usage or are not easy to configure. In this post I will explain how URL Rewrite Module for IIS 7.0 can be used to configure IIS and RoR to work correctly with static files.

Continue Reading »

31 Comments »

ruslany on August 7th 2008 in FastCGI, URLRewrite

54,113 views

PoorFairAverageGoodExcellent (6 votes, average: 4.83 out of 5)

Recently Published Articles