Enable FastCGI Support in IIS 7 on Windows

by Tali Smith


Internet Information Services 7 (IIS 7) and above comes with extended support for application frameworks through FastCGI, an open protocol supported by many open-source application frameworks that otherwise may not support stable and high-performance native integration with IIS.FastCGI provides a high-performance alternative to the Common Gateway Interface (CGI), a standard way for external applications to interface with Web servers that has been supported as part of the IIS feature set since the first release.

For example, PHP traditionally runs on IIS either as an ISAPI extension or as a CGI program. CGI programs are executables launched by the Web server to output dynamic information; CGI applications run in a separate process that is created at the start of each request and terminated at the end. The "one process per request" model makes CGI programs simple to implement but can limit efficiency and scalability. ISAPI extensions execute inside the IIS worker process on multiple threads.

FastCGI lets a single, long-running process handle multiple user requests; it retains the simplicity of the CGI programming model while eliminating much of the overhead. FastCGI addresses the performance issues inherent in 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 handles only one request at a time.

The FastCGI module lets PHP developers get dramatically better performance, scalability, and reliability when running on Windows® operating systems. The FastCGI module also enables easy integration with the new features of IIS (such as the new output caching features) and with Microsoft® ASP.NET.

Before You Begin

Windows Server® 2008 R2, Windows Server® 2008, Windows Vista®, or Windows® 7, and IIS 7 or above must be installed.

Enable FastCGI Support

  1. Add the CGI role service by going to Server Manager > Roles > Add Role Services.
  2. Under Application Development, select the CGI check box. This enables both the CGI and FastCGI services (selecting CGI enables both CGI and FastCGI).
    Screenshot of Add Role Services dialog with C G I selected under Application Development.
    Figure 1: Select Role Services page
  3. Confirm the selections on the Confirm Installation Selection page, and then click Install.
  4. The Installation Results page shows that the installation succeeded. Click Close.
  5. The CGI role service appears under the IIS panel.

Enable FastCGI Support in Windows 7 and Windows Vista SP1

IIS 7.0 for Windows Vista® Service Pack 1 (SP1) includes a built-in FastCGI component. (Note that IIS 7.0 included in Windows Vista without SP1 does not include FastCGI component.) To get FastCGI support on IIS 7.0 in Windows Vista, you must upgrade to Windows Vista SP1.

The steps to enable FastCGI in Windows 7 are similar.

  1. Add the CGI role service by going to Control Panel > Programs and Features > Turn Windows features on or off.
    Screenshot of the enabled C G I features in Programs and Features.

    Figure 2: Windows Features page

Install the Update for FastCGI Module

The update for the IIS FastCGI module fixes several known compatibility issues with popular PHP applications. Install the update from one of the following locations:

Install the Administration Pack for IIS 7.0 and Above


This step is optional.

The IIS 7.0 Administration Pack adds to the set of management features that ship with IIS to include Administration UI support for ASP.NET authorization, custom errors, FastCGI configuration, request filtering, and much more. The Administration Pack also provides a generic configuration editor that is capable of setting any IIS configuration setting and automatically generating scripts to make the task easily repeatable.


This article uses information from Using FasCGI to Host PHP Applications on IIS 7.0 and Above by Ruslan Yakushev, published on December 5, 2007.

See also