Description: This article according to the network article modification, not completely original!
A. Lift Awake
Let's briefly say that PHP runs under IIS in the form of ISAPI and fastcgi. Starting with the php.5.3.1 version, there is no longer a way to run the IIS security thread (that is, no ISAPI is available to run PHP), only the threaded-safe version of PHP (FastCGI). For PHP thread safety and non-wire program security (non thread safe), Baidu Google itself. In addition, PHP5.5 started, it is not supported on XP and Win2003, and only php5.4x version can be installed on Win2003.
Two Software Requirements and Downloads
- Php5.4.0 (VC9 x86 Non Thread safe),: Http://windows.php.net/downloads/releases/php-5.4.0-nts-Win32-VC9-x86.zip
- FastCGI (for Windows),: http://download.microsoft.com/download/E/0/C/E0C0709A-66E5-4113-9A6C-A5F65BF6717D/ Fcgisetup_1.5_rtw_x86.msi, you can also install fastcgi through Microsoft's Web platform Installer.
Three. Software Installation
1. Install IIS6.0 first. Then install FASTCGI, always click Next. After installation, there will be five more files on fastcgi under the c:\windows\system32\inetsrv\ path.
One of the key reminders is to fcgiext.ini the configuration of this file. Double-click to open it for editing. At the bottom, write the passage in addition to the comment.
[Types] php=php[php]exepath=D:\PHP\ Php-cgi.exeinstancemaxrequests=10000activitytimeout=300requesttimeout=600 Environmentvars=php_fcgi_max_requests:10000
Of these, there are two options that are required
[Types]
Php=php This is a description, fastcgi is supported by PHP
The other one is
[PHP]
Exepath=c:\php\php-cgi.exe for IIS to execute PHP, you must find php-cgi to execute.
Other parameter settings, you can according to your own needs to get. If you want to know the exact meaning, you can also search Google.
2.php5.4.0 installation configuration.
Extract the downloaded php5.4.0 to the x: Disk (x disk is your own hard disk partition, you can define it at will). After extracting, get the Php-5.4.0-nts-win32-vc9-x86 folder and change this folder to PHP. (This is also can be arbitrarily self-righteousness, modified to PHP is for the convenience of memory) there are two files about php.ini settings. One is php.ini-development (for the development environment with the php.ini), one is php.ini-production (for publishing sites with the php.ini), generally we are officially released to use the site, we will choose Php.ini-production, rename the php.ini-production to php.ini and open it directly to edit the contents. Focus on a few configuration files.
[Date]
; Defines the default timezone used by the date functions
; Http://php.net/date.timezone
; Date.timezone =
Change to and remove the preceding ";":
[Date]
; Defines the default timezone used by the date functions
; Http://php.net/date.timezone
Date.timezone = Asia/shanghai
If you do not change the above Date.timezone may open the webpage will prompt 500 wrong, I have tried several times is this.
Found it
; On Windows:
; Extension_dir = "ext"
Switch
; On Windows:
Extension_dir = "X:\PHP\ext" (X: For your partition, PHP is your PHP directory)
Found: Fastcgi.impersonate = 1; This sentence, put in front of; remove, fastcgi.impersonate = 1, as
Found: short_open_tag= Off;
Short_open_tag= on
Remember to modify the Extension_dir for your PHP extension directory Oh, or you will not be able to run PHP.
As for the php.ini inside of the extension open mode, according to their own needs, find: Windows Extensions in the dynamic module configuration under Windows Extensions, you need to open the following module support: (Remove the module configuration in front of each line For example, mine is:
Extension=php_bz2.dll
Extension=php_curl.dll
Extension=php_dba.dll
Extension=php_mbstring.dll
Extension=php_exif.dll
Extension=php_mysql.dll (This is a run MySQL extension, to use MySQL, must be turned on)
.........................
If you have PHP function can not use, go to php.ini Find them out, remove; Semicolons enable them
The following step setting is a more important setting.
We need to set up two environment variables in the Windows system.
1. Add the PHP directory to the PATH environment variable (this is to allow Windows to find PHP execution)
Right click [My Computer], select the properties, choose the "Advanced" tab, click on the "Environment variables" button, in the "System variables" column to find the path (may need to scroll down to find), the mouse double-click Path this item at the end to add your PHP directory, including the previous ";" (such as:; X:\PHP, remember Oh, x disk is your partition) click "OK"
2. Make the php.ini file available in PHP under Windows:
Right click [My Computer], choose Properties, select "Advanced" tab, click "Environment Variables" button, in the "System Variables" column
Click on the "New" button and enter "PHPRC" in "Variable name", enter the directory where the php.ini file is located in "Variable value" (for example: X:\php), click "OK" [as shown in ↑]
Three. IIS Settings support PHP
The following step is the last step.
Open IIS Manager, right-click on the Web site-Properties-Home Directory-configuration-Add, configure as
Executable file path: C:\WINDOWS\system32\inetsrv\fcgiext.dll
Related Permissions Configuration
I generally add users ' user rights to read and write.
Finally, 7. Write a PHP test.
This step is important when you finish modifying the IIS service by running the IISRESET command on IIS or at the command prompt!
Test if the installation is successful!
To create a Web site, the contents of the phpinfo.php file are:
Files: phpinfo.php
<?phpphpinfo ();? >
See an effect similar to the following to show that your server can run PHP.
Common Error Resolution:
FastCGI Error
The FastCGI Handler was unable to process the request.
Error Details:
Error number:193 (0X800700C1).
Error Description:unknown Error
HTTP Error 500-server error.
Internet Information Services (IIS)
-"PHP5.5 started, has not supported XP and Win2003 run on. only the php5.4x version can be installed on Win2003 .
Workaround:
The key to the error is that the VC9 runtime is not installed as Visual C + + 2008
Microsoft Visual C + + Redistributable Package (x86):
Http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=zh-cn
Win2003 + IIS6.0 + Php5.4 (FastCGI) configuration