The IIS FastCGI extension enables popular application frameworks that support FastCGI protocol to be hosted on the IIS web server in a high-performance and reliable way. FastCGI provides a high-performance alternative to the Common Gateway Interface (CGI), a standard way of interfacing external applications with Web servers that has been supported as part of the IIS feature-set since the very first release.
CGI programs are executables launched by the web server for each request in order to process the request and generate dynamic responses that are sent back to the client. Because many of these frameworks do not support multi-threaded execution, CGI enables them to execute reliably on IIS by executing exactly one request per process. Unfortunately, it provides poor performance due to the high cost of starting and shutting down a process for each request.
FastCGI addresses the performance issues inherent to CGI by providing a mechanism to reuse a single process over and over again for many requests. Additionally, FastCGI maintains compatibility with non-thread-safe libraries by providing a pool of reusable processes and ensuring that each process will only handle one request at a time.
This release of FastCGI Extension includes these new features:
Monitor changes to a file. The extension can be configured to listen for file change notifications on a specific file and when that file changes, the extension will recycle FastCGI processes for the process pool. This feature can be used to recycle PHP processes when changes to php.ini file are made.
Real-time tuning of MaxInstances setting. This MaxInstances setting dictates the maximum number of FastCGI processes which can be launched for each application pool. If it is set to 0 then FastCGI extension will automatically adjust the number of instances up or down every few seconds based on the system load and number of requests waiting in the queue. Default value of MaxInstances setting has been changed from 10 to 0.
STDERR stream handling. There are several options of how the extension can handle text sent by FastCGI application on STDERR. The extension 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.
Sending a termination signal to FastCGI processes. The extension can be configured to send a termination signal to FastCGI process before terminating it. This enables FastCGI process to do a clean shutdown before getting killed.
_FCGI_X_PIPE_ environment variable. This variable is set by FastCGI extension and it contains the name of the named pipe that is used for communication between the extension and FastCGI process.
Relaxed enforcement of response headers syntax. The FastCGI extension has less strict enforcements for the correctness of the response headers.
Application specific mappings. In addition to site specific mappings which let users choose a different mapping for a site, FastCGI 1.5 release lets you specify a mapping for a particular application within a site. Eg. php:/w3svc/1/drupal=php_for_drupal
To use FastCGI Extension 1.5, you must have one of the following operating systems with IIS installed:
There are two separate downloadable packages for the module; you will need to download the appropriate package for your version of Windows OS:
You will need to run the installation package as an administrator. This can be accomplished by one of the following methods:
msiexec /I <msi_filename>
If you already have the FastCGI Extension version 1.0 or version 1.5 beta/rc installed then the installation package will upgrade it to version 1.5 RTW. All the configuration settings in IIS and fcgiext.ini file will be preserved.
If you encounter any problems during installation, you can run appropriate command listed below for your version of Windows to create a log file that will contain information about the installation process:
msiexec /I <msi_filename> /l* fcgiext.log
You can analyze this log file after a failed installation to help determine the cause of the failure.
Using UTF-8 encoding for server variables
By default, FastCGI extension uses ASCII encoding when setting server variables that are used by PHP. When requested URL contains non-ASCII characters, then server variables that derive their values from the requested URL string may be set incorrectly. PHP applications that rely on those server variables may not work because of that.
To prevent this the FastCGI extension can be configured to use UTF-8 encoding when setting server variables. To configure FastCGI to use UTF-8 encoding for a particular set of server variables, use the REG_MULTI_SZ registry key FastCGIUtf8ServerVariables and set its value to a list of server variable names, for example:
reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\w3svc\Parameters /v FastCGIUtf8ServerVariables /t REG_MULTI_SZ /d REQUEST_URI\0PATH_INFO
The above example will configure FastCGI extension to use UTF-8 encoding when setting REQUEST_URI and PATH_INFO server variables.
After setting the registry key restart the IIS by using the iisreset command.
Warning: using UTF-8 encoding for server variables may affect how PHP core and PHP applications work. Make sure to verify that applications work as expected after the registry key has been changed.
© 2009 Microsoft Corporation.