PHP for windows has no longer supported ISAPI loading since PHP5.3. According to Microsoft's recommendation, FastCGI is the best and fastest way to load the php environment, fastCGI greatly enhances IIS's ability to process PHP, rapidly improves the response speed and productivity of PHP sites, and has higher stability and security.
There are three main ways to build a PHP environment on IIS:
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.
PHP for windows has no longer supported ISAPI loading since PHP5.3. According to Microsoft's recommendation, FastCGI is the best and fastest way to load the php environment, fastCGI greatly enhances IIS's ability to process PHP, rapidly improves the response speed and productivity of PHP sites, and has higher stability and security.
The following hands-on configuration of PHP environment, IIS + FastCGI using PHP, You need to download VC9 Non Thread Safe version, for the http://windows.php.net/download/ before installing PHP, first of all, we should install IIS FastCGI for IIS (IIS7 has been built in), for the http://www.iis.net/expand/fastcgi next is to install Php, the installation process only one step is worth noting, that is, the need to select IIS FastCGI:
After the installation is complete, open the command prompt and enter the following command
The Code is as follows: |
Copy code |
Cd C:/WINDOWS/system32/inetsrv cscript fcgiconfig. js-add-section: "PHP"-extension: php-path: "C:/Program Files/PHP/php-cgi.exe" # Note: path: "xxxx/php-cgi.exe & rdquo; is the directory where you install php cscript fcgiconfig. js-set-section: "PHP"-InstanceMaxRequests: 10000 cscript fcgiconfig. js-set-section: "PHP"-EnvironmentVars: PHP_FCGI_MAX_REQUESTS: 10000 |
OK! Finished! Test: Create a. php file with the following content:
The Code is as follows: |
Copy code |
<? Php Phpinfo (); ?> |
If the following interface is displayed, you can do it!
This method does not need to be configured in IIS. It will be automatically configured! If the php test page is run after the configuration is completed according to the above tutorial, Error 500 is displayed. Set the date. timezone item in php. ini. Set it to the Shanghai Time Zone: date. timezone = Asia/beijing. After the settings are complete, everything works!