Detailed description of FastCGI installation configuration for IIS6 configuration PHP environment in Winodws2003

Source: Internet
Author: User
Tags configuration php ini php and register php vc9

We know several php configurations:

1. Cgi PHP environment. Generally, php.exe is used as the interpreter in iis.
Features: stability, but low efficiency.

2. The ISAPI method is used to load the PHP environment. The configuration interpreter in IIS is php5isapi. dll, which is currently the most widely used and widely used.
Features: multithreading, high efficiency, but not stable enough.

3. FastCGI loading PHP environment is not common in the IIS environment, but there are still some applications in other system environments, but IIS7.0 has started to build FastCGI.
Features: high efficiency and high stability are future development trends.

I have tried other problems. The Windows version released by PHP 5.3 does not support the ISAPI mode, so I plan to run PHP in The FastCGI mode recommended by Microsoft.

I use the third method and the best and fastest, because FastCGI greatly enhances IIS's ability to process PHP and can quickly improve the response speed and productivity of PHP sites.

Configuration method

1. Install IIS

For more information about the installation method, see http://down.chinaz.com/server/201102/11_1.htm.

2. Download and install IIS FastCGI

Download Address: http://www.iis.net/download/fastcgi.

Select x86 or download x86, and the download name is fcgisetup_1.5_x86_rt1_msi.

After installation
At this time, a FastCGI Handler is added to the "WEB service extension" of IIS6.

 


3. Download and install the latest PHP version under IIS
Download Address: http://windows.php.net/download/, download the ZIP version of vc9 x86 Non Thread Safe, and decompress it to the desired directory, which requires the user to read and run permissions.
IV. Configuration and modification content
1. Modify environment variables
My computer-> Properties-> Advanced-> environment variables-> System variables, add them to the end of Path; E: PHP
2. Modify the FastCGI installation directory (register PHP to FastCGI)
Open the C: WINDOWSsystem32inetsrvfcgiext. Ini file and add the following statement at the end of the file:
The code is as follows: Copy code
[Types] (this is the original file. You can add the following statement after [Types]. Otherwise, an error will be reported .)
Php = PHP
[PHP]
ExePath = E: PHPphp-cgi.exe
Instancemax requests = 10000
EnvironmentVars = PHP_FCGI_MAX_REQUESTS: 10000
ActivityTimeout = 3600
RequestTimeout = 3600
3. PHP. ini modification. PHP installation directory does not contain PHP. only php. ini-development and php. ini-production. change ini-development to php. ini (if you are afraid of mistakes, back up it first ).
Note: First, create a folder named TMP and place it randomly. I will put it here in E: PHPtmp. (Upload_tmp_dir will be used, and upload_tmp_dir is used to define the temporary PATH for storing the uploaded file. Here, you can modify and define an absolute path for it, and you must have the read and write permissions ).
Use the shortcut key Ctrl + F to change the following keyword to the current value:
The code is as follows: Copy code
Short_open_tag = Off (this is the default, so we should not change it .)
Change; upload_tmp_dir = to upload_tmp_dir = "E: PHPtmp"
Change; cgi. force_redirect = 1 to cgi. force_redirect = 0
Change; fastcgi. impersonate = 1; to fastcgi. impersonate = 1;
Change; extension_dir = "ext" to extension_dir = "E: PHPext"
Change; date. timezone = to date. timezone = PRC (if you do not modify date. timezone, the error 500 may occur when you open the webpage. Someone has changed the value to Asia/Shanghai. I have never tried it. You can try it .)
Remove the semicolon (;) before the extension in Windows Extensions (;):
; Extension = php_curl.dll
; Extension = php_gd2.dll
; Extension = php_ldap.dll
; Extension = php_mbstring.dll
; Extension = php_exif.dll
; Extension = php_mysql.dll
; Extension = php_mysqli.dll
; Extension = php_sockets.dll
; Extension = php_xmlrpc.dll
4. Modify Internet Information Service (IIS) manager
(1) Add website, properties, home directory, and configuration
Enter the executable file C: WINDOWSsystem32inetsrvfcgiext. dll
Enter. php extension.
Action> limit: GET, HEAD, and POST.
(2) choose website> Properties> Document> add default content index. php. All the configurations are complete. You must restart the IIS service.
5. Test
Write a test code in text:
123
<? Phpphpinfo ();?>
Save it as index. php. You can get the name as long as the suffix is. php. Put index. php in the root directory. Here I am C: Inetpubwwwroot, and enter http: // localhost/index. php in the browser to get the returned information.
V. Debugging errors
If the following error occurs, your computer has not installed the VC9 runtime library, that is, visual c ++ 2008.
Microsoft Visual C ++ 2008 Redistributable Package (x86)
Download Address: http://www.microsoft.com/downloads/zh-cn/details.aspx? FamilyID = 9B2DA534-3E03-4391-8A4D-074B9F2BC1BF & displaylang = zh-cn
Download and install it.

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.