IIS configures the PHP environment (the latest version). Today, a small web environment is required to run in the php environment. it has suffered a lot for configuration! Finally, the following information is displayed:
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,
And has higher stability and security.
: Http://windows.php.net/download/there are many types in it. what about that?
PHP version 5.3.2 is now available, but there are several different versions to download. That is, VC6 X86 and VC9 X86.
First, let me answer:
What is VC6?
VC6 is compiled by the legacy Visual Studio 6 compiler.
What is VC9?
VC9 is the Visual Studio 2008 compiler, which is compiled by Microsoft VS editor.
So how do we choose which PHP version to download?
If you are using Apache + PHP in windows, select VC6;
If you are using IIS + PHP in windows, select VC9;
What is Non Thread Safe?
Non-Thread Safe is Non-Thread security;
What is Thread Safe?
Non Thread Safe is Thread security;
FastCGI executes operations in a single thread, so it does not need to perform thread security checks. apart from the thread security check protection, it can improve the execution efficiency, if you use FastCGI (whether with IIS 6 or IIS 7) to execute PHP, we recommend that you download and execute non-thread safe PHP (PHP 2? ? Yes ?? Pack? Method: msi, zip ,? Lower? Zip kit) so we chose PHP of NO-Thread Safe version for use.
The Thread security check is prepared for PHP in The ISAPI mode. because many php modules are not Thread-Safe, Thread Safe PHP is required.
Download and Install. the default installation path is:
Remember to select the third item: IIS FASTCGI
If you do not install iis fastcgi, you will be prompted if it is not installed. download and install it.
FastCGI for IIS 6 7 http://www.iis.net/expand/fastcgi
After installation, continue to the next step. I followed the default settings:
After the installation is complete, the configuration is complete.
There are two methods for this configuration. I can configure it with cmd, just a command.
Go to the CGI installation directory:
> 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 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.
Phpinfo ();
?>
Save!
Run. the following page is displayed, indicating that the configuration is successful!
This method does not need to be configured in IIS. it will be automatically configured! Configuration provided by Microsoft is more detailed!
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 Shanghai Time zone: date. timezone = Asia/beijing
After the settings are complete, everything is normal!