IIS7 configuration PHP environment graphic tutorial (fastcgi fast latest version)

  
                  

We know that there are several php configurations:

1, CGI mode to load PHP environment, usually IIS configuration interpreter for php.exe, early is more common, currently used less.
Features: stable, but the efficiency is too low.

2, ISAPI mode to load the PHP environment, usually the IIS configuration interpreter is php5isapi.dll, currently the most used, the most widely used.
Features: multi-threaded, high efficiency, but not stable enough.

3. The FastCGI method loads the PHP environment, which is not common in the IIS environment, but other system environment applications still exist, but IIS7.0 starts to build FastCGI.
Features: high efficiency, high stability, is the future development trend.

I have tried other special troubles. The Windows version released by PHP 5.3 does not support ISAPI mode, so I plan to run PHP according to Microsoft's recommended FastCGI method.

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

With higher stability and security.

Download address: http://windows.php.net/download/There are many kinds inside, what kind of?

PHP is now available in version 5.3.2, but there are several different versions to choose from when downloading. That is the VC6 X86 and VC9 X86.
First of all, I will answer:
What is VC6?
VC6 is the legacy Visual Studio 6 compiler, which is compiled using this compiler.
What is VC9?
VC9 is the Visual Studio 2008 compiler, which is compiled with Microsoft's VS editor.

How do we choose which version of PHP to download?
If you are using Apache+PHP under Windows, please choose VC6 version;
If you are using IIS+PHP under Windows, please select VC9 version;

Non Thread Safe What is it?
Non Thread Safe is non-thread safe;
What is Thread Safe?
Non Thread Safe is thread safe;
The official does not recommend that you apply Non Thread Safe to the production environment, so we choose Thread The Safe version of PHP is used.


Download and install, I installed the default path:


Remember to select the third item: IIS FASTCGI


If you don't have IIS FASTCGI installed, you will be prompted to install it.

FastCGI for IIS 6 7 http://www.iis.net/expand/fastcgi



After installation, continue to the next step, I follow the default:


After the installation is complete, it is configured.

This configuration has two methods, I use cmd configuration, a command will do.




Go to the directory where you just installed CGI:

>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" is the directory where you installed php

> cscript fcgiconfig.js -set -section:"PHP" -InstanceMaxRequests:10000
> cscript fcgiconfig.js -set -section:"PHP" -EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000


ok! Finish!

Test:

Create a new .php file, inside

<?php

phpinfo();

?> ;
Save!

Run, the following page appears, indicating that the configuration is successful!


This method IIS does not need to be configured, he will automatically configure it! The configuration provided by Microsoft is more detailed!

If you follow the above tutorial configuration, run the php test page, there is a 500 error.

Set the date.timezone item in php.ini.

I set it to Shanghai time zone here: date.timezone = Asia/beijing

After setting, everything is fine!

Copyright © Windows knowledge All Rights Reserved