FastCGI module in IIS 7.0 has been lacking some of the features and bug fixes that are available in IIS 7.5 FastCGI module and in FastCGI Extension 1.5 on IIS 5.1 and IIS 6.0. The reason why this happened are explained in the post about FastCGI Module: Differences across IIS versions. This week IIS team has released an update for FastCGI module in IIS 7.0 that closes this remaining feature gap and ensures that FastCGI functionality is consistent across all versions of IIS.
The update can be downloaded from the following locations:
- Update for Windows Server 2008 (KB980363)
- Update for Windows Server 2008 for Itanium-based Systems (KB980363)
- Update for Windows Server 2008 x64 Edition (KB980363)
- Update for Windows Vista (KB980363)
- Update for Windows Vista for x64-based Systems (KB980363)
The features that are enabled by this update:
- Monitor changes to a file. The module can be configured to listen for file change notifications on a specific file and when that file changes, the module will recycle FastCGI processes for the process pool. This feature can be used to recycle PHP processes when changes to php.ini file occur. To enable this feature use the monitorChangesTo setting in the <fastCgi> configuration element.
- Real-time tuning of MaxInstances setting. This MaxInstances setting dictates the maximum number of FastCGI processes which can be launched for each application pool. Set it to 0 to let FastCGI module automatically adjust the number of instances up or down based on the system load and number of requests waiting in the queue.
- STDERR stream handling. There are several options of how the module can handle text sent by FastCGI application on STDERR. The module can send the error data as a failure response to the HTTP client or it can ignore the error and send whatever was received on STDOUT as a response with 200 status code. This behavior is controlled by the stderrMode setting.
- Sending a termination signal to FastCGI processes. The module can be configured to send a termination signal to FastCGI process before terminating it. This enables FastCGI processes to do a clean shutdown before getting killed. The signalBeforeTerminateSeconds setting can be used to specify how long the module will wait before it forcefully shuts down the FastCGI process that does not respond to the termination signal. This feature is disabled by default.
- _FCGI_X_PIPE_ environment variable. This variable is set by FastCGI module and it contains the name of the named pipe that is used for communication between the module and FastCGI process.
- Relaxed enforcement of response headers syntax. The FastCGI module now has less strict enforcements for the correctness of the response headers.
- Using UTF-8 encoding for server variable values. By default FastCGI uses ASCII encoding when setting server variables. If a FastCGI application requires UTF-8 encoded values for certain server variables, the module can be configured to use UTF-8 only for required server variables. Follow these instructions to enable this functionality.
Note: To get UTF-8 encoding support in IIS 7.5 in Windows 7 and Windows Server 2008 R2 download the KB 2277918 hotfix.
In addition to that several important bugs have been fixed, most notable of those are the ones reported by Franklin Tse:
- FastCGI module replaces redirect status code set by PHP with HTTP 302
- Custom application errors were masked by the generic IIS errors
If you are using IIS 7.0 to host PHP applications, then it is highly recommended to apply this update to ensure you have the latest version of FastCGI module.