PHP Installation Guide in II7 references:
Using FastCGI to Host PHP Applications on IIS 7.0
I. PHP installation
1. download and install the program
PHP 5.2.8 Non-thread-safe zip package
The update for FastCGI module
Administration Pack for IIS 7.0
IIS7 and PHP problems in Win2008
2. configure php. ini
Copy C: \ PHP \ php. ini-recommended to php. ini and modify the file:
Fastcgi. impersonate = 1
Cgi. fix_pathinfo = 1
Cgi. force_redirect = 0
Open_basedir = "G: \ Projects_PHP"
Extension_dir = "c: \ php \ ext"; extension_dir = "./"
Extension = php_mssql.dll
Extension = php_mysql.dll
Extension = php_gd2.dll
Extension = php_mbstring.dll
Extension = php_mcrypt.dll
Extension = php_pdo.dll
Extension = php_pdo_mysql.dll
Extension = php_pdo_mysql.dll
Here, open_basedir indicates the directory where the website is located. you can also specify it as "G: \", so that any website under the drive G can be within the security scope.
# To use the session, you need to add session. save_path = "c: \ php \ tmp" and create the directory tmp
# Extension_dir = "c: \ php \ ext"
3. configure IIS
IIS root --> Handler Mappings -->
Request path: *. php
Module: FastCgiModule
Executable: "C: \ PHP \ php-cgi.exe"
Name: PHP via FastCGI
IIS root --> FastCGI settings --> Edit... --> Edit FastCGI application --> instanceMaxRequest = 10000
--> EnvironmentVariables --> PHP_FCGI_MAX_REQUESTS = 10000
4. recommended security configurations (for reference only)
Allow_url_fopen = Off
Allow_url_include = Off
Register_globals = Off
Open_basedir = "c:" inetpub ""
Safe_mode = Off
Safe_mode_gid = Off
Max_execution_time = 30
Max_input_time = 60
Memory_limit = 16 M
Upload_max_filesize = 2 M
Post_max_size = 8 M
Max_input_nesting_levels = 64
Display_errors = Off
Log_errors = On
Error_log = "C:" path "of" your "choice"
Fastcgi. logging = 0
Expose_php = Off
5. independent configuration
Reference: http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/
In "Per-site PHP process pools" and "Specifying php. ini location"
A. IIS root --> FastCGI Settings --> Add Appliction... --> fullPath = "C: \ PHP \ php-cgi.exe"
Arguments = "-d open_basedir = G: \ Projects_PHP \ Samples \ PHP_Hello2"
View the following configuration in C: \ windows \ system32 \ inetsrv \ config \ applicationHost. config:
<FastCgi>
<Application fullPath = "C: \ PHP \ php-cgi.exe" instanceMaxRequests = "10000">
<EnvironmentVariables>
<EnvironmentVariable name = "PHP_FCGI_MAX_REQUESTS" value = "10000" type = "codeph" text = "/codeph"/>
<App fullPath = "C: \ PHP \ php-cgi.exe"
Arguments = "-d open_basedir = G: \ Projects_PHP \ Samples \ PHP_Hello2" maxInstances = "4" idleTimeout = "300" activityTimeout = "30" requestTimeout = "90"
InstanceMaxRequests = "200" protocol = "NamedPipe" queueLength = "1000" flushNamedPipe = "false"
RapidFailsPerMinute = "10"/>
B. modify the web. config of the website.
<Configuration>
<System. webServer>
<Handlers accessPolicy = "Read, Script">
<Remove name = "PHP via FastCGI"/>
<Add name = "PHP via FastCGI" path = "*. php "verb =" * "modules =" FastCgiModule "scriptProcessor =" C: \ PHP \ php-cgi.exe |-d open_basedir = G: \ Projects_PHP \ Samples \ PHP_Hello2 "resourceType =" Unspecified "requireAccess =" Script "/>
6. configure environment variables
For example, the installation directory is in c: \ php
Configure the Path variable to add C: \ PHP \;
7. install the URL Rewrite Module
Download rewrite_x86_rt1_msi
Reference: URL Rewrite Module Using URL Rewrite Module Configuration Reference