Run PHP with FastCGI in IIS 6

Source: Internet
Author: User
Tags register php

Environment:
Operating System: Windows 2003 Server SP2
PHP version: php-5.2.6-Win32

1. Download FastCGI for IIS6

Http://www.iis.net/download/fastcgi

After downloading the SDK, double-click it to install it.

After installation, five files are generated in the c: \ windows \ system32 \ inetsrv directory. For example:

    1. Fcgiext. dll-FastCGI ProcessingProgram
    2. Fcgiext. ini-configuration file
    3. Fcgiconfig. js-FastCGI control script

FastCGI handler is added to the "Web Service extension" of IIS.


2. Download php5.2.14 for Windows

Http://www.php.net/downloads.php

Download the. Zip version, decompress it to the C: \ PHP Directory, and grant the read and run permissions to the IIS startup account group or users. For example:


You can decompress the package to another directory as needed.

3. Register PHP to FastCGI

Open the c: \ windows \ system32 \ inetsrv \ fcgiext. ini file.

; This is the configuration file for the FastCGI handler for IIS 6.0.
; The FastCGI handler will look for this file in the same directory
; Fcgiext. dll. By default, the FastCGI installer will place this file
; The % WINDIR % \ system32 \ inetsrv directory.

My personal understanding is that when FastCGI handler in "Web Service extension" is allowed, fcgiext is loaded. the fcgiext. the content of the ini configuration file provides ing for each website according to the configuration in it.

Add the following configuration under [Types:

[Types]
PHP = PHP

[PHP]
Exepath = c: \ PHP \ php-5.2.14-Win32 \ php-cgi.exe

"Php" indicates the extension. "php" is the name of the configuration section, which is defined in "[PHP.

4. Configure PHP. ini

Copy one of c: \ PHP \ php-5.2.14-Win32 \ PHP. ini-recommended and rename it D: \ PHP. ini

Open c: \ PHP \ php-5.2.14-Win32 \ PHP. ini, modify:

Extension_dir = "C: \ PHP/php-5.2.14-Win32 \ Ext"
FastCGI. Impersonate = 1

 

Modify the settings of PHP. ini as needed. Here, you can only run php, and restart IIS after modification.

5. Configure the website

Right-click a website and choose Properties> Home directory> Configuration> Add, as shown in the following figure:


Executable File Path: c: \ windows \ system32 \ inetsrv \ fcgiext. dll

6. Write a PHP test.

<? PHP
Phpinfo ();
?>

The following results show that your server can run php.


If no input file specified is displayed, it is estimated that FastCGI. Impersonate is not configured.

Reference http://hi.baidu.com/imdao/blog/item/16583512f11cb654f819b858.html

Configure the FastCGI extension for IIS 6.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.