Udostępnij za pośrednictwem


Enabling FastCGI on IIS 7

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

This topic discusses how to enable FastCGI on your IIS 7 Web server. By using FastCGI instead of CGI to run your CGI applications, you can increase reliability and improve performance.

For example, PHP traditionally runs on IIS either as an ISAPI extension or as a Common Gateway Interface (CGI) program. ISAPI extensions execute inside the IIS worker process on multiple threads.

Using FastCGI provides a high-performance alternative to CGI by reusing CGI processes to service subsequent requests. PHP still runs single-threaded in one or more processes in the FastCGI pool. For more information about FastCGI, see FastCGI for IIS.

You can also add functionality to your FastCGI application by installing other IIS modules on your Web server. For example, you can add the .NET Extensibility module to enable changes, additions, and extensions of Web server functionality in the request pipeline, configuration, and UI. On the other hand, you can add the Output Cache module to support output caching and to store static or dynamic content in memory. For more information about the IIS modules available for your Web server configuration, see Introduction to IIS 7.0 Architecture and IIS7 Modules Overview.

Note

You must be logged on as a member of the Administrators group to perform this task.

The following table describes the purpose of the IIS feature that is required to use FastCGI. Installing the FastCGI component enables your IIS 7 server to run CGI applications such as PHP. You still must install the CGI applications separately.

IIS feature name Description

CGI

Contains the CGI and FastCGI modules. The FastCGI module provides a high-performance alternative to CGI.

To deploy a FastCGI-enabled server

You can use the Web Platform Installer (Web PI) to easily install IIS, and applications that run on IIS. Because the Web PI installs the latest versions of available Web Platform offerings, with just a few simple clicks you can download and install any new tools or updates. To learn more about the Web PI, see Learn more and install the Web PI.

You can also perform this procedure by using the Windows user interface (UI) or from a command line.

To use the UI on Windows Server 2008 or Server 2008 R2

  1. Click Start, point to Administrative Tools, and then click Server Manager.

  2. In Roles Summary, click Add Roles.

  3. Use the Add Roles Wizard to add the Web Server (IIS) role.

    For detailed instructions about how to install a default IIS 7 Web server, see Deploying a Static Content Server (IIS 7).

  4. On the Select Role Services page, note the preselected role services that are installed by default, and then select the following additional role service:

    • CGI
  5. On the Summary of Features to Install page, confirm your selections, and then click Install.

  6. On the Installation Results page, confirm that your installation of the Web Server (IIS) role and required role services completed successfully, and then click Close.

To use the UI on Windows Vista or Windows 7

  1. Click Start, and then click Control Panel.

  2. In Control Panel, click Programs, and then click Turn Windows features on or off.

  3. In the Windows Features dialog box, click Internet Information Services to install the default features, and then select the following additional feature in the Application Development Features section:

    • CGI
  4. Click OK to close the Windows Features dialog box.

To use the command line

  • Type the following command into a script:

    Start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-Security;IIS-RequestFiltering;IIS-HttpCompressionStatic;IIS-WebServerManagementTools;IIS-ManagementConsole;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI;IIS-CGI