IIS7+FASTCGI Configuration PHP Environment in Windows

Source: Internet
Author: User
Tags configuration php install php


There are three ways to build a PHP environment on IIS, and the pros and cons are as follows:

1, the CGI load PHP environment, is usually IIS inside the configuration interpreter for Php.exe, early more common, currently use less. Characteristic is: stable, but the efficiency is too low.

2, ISAPI loading PHP environment, is usually IIS inside the configuration interpreter for Php5isapi.dll, currently used most, the most widely used. Features are: multithreading, high efficiency, but not stable.

3, fastcgi way to load the PHP environment, in the IIS environment is not common, but other systems environment applications are still available, but IIS7.0 began to build the built-in fastcgi. Features are: High efficiency, stability, belong to the future development trend.

Starting with PHP5.3, PHP for Windows no longer supports ISAPI loading, according to Microsoft's recommendation, the fastcgi way to load the PHP environment is currently the best and fastest, because fastcgi greatly enhanced the ability of IIS to handle PHP, Can quickly improve the PHP site response speed and productivity, and has a higher stability and security.

The following hands-on configuration PHP environment, iis+fastcgi use PHP, you need to download VC9 non Thread safe version, download the address for http://windows.php.net/download/before installing PHP, First we should install IIS FastCGI to IIS (IIS7 is already built), download the address for http://www.iis.net/expand/fastcgi next is install PHP, there is only one step in the installation process to be aware of, is to select the IIS FastCGI in the following figure:

When the installation is complete, open the command prompt and enter the following command

  code is as follows copy code
CD c:/windows/system32/inetsrv 
cscript Fcgiconfig.js-ad D-section: "PHP"-extension:php-path: "C:/Program files/php/php-cgi.exe"
#注意: Path: "xxxx/php-cgi.exe” Are you installing PHP directory  
cscript fcgiconfig.js-set-section: "PHP"-instancemaxreques ts:10000 
cscript fcgiconfig.js-set-section: "PHP"-environmentvars:php _fcgi_max_requests:10000

Ok! finished! Under test: Create a new. php file with the following contents:

The code is as follows Copy Code

<?php

Phpinfo ();

?>

If you open the following interface, the difference is made!

This way IIS does not have to configure, he will be automatically configured! If you run the PHP test page with the following tutorial configured, there are 500 errors. Then set the Date.timezone item in the php.ini. I set up here into the Shanghai time zone: Date.timezone = asia/beijing After setting up everything is OK!

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.