Prepare an article
1, related software download address:
Microsoft Visual C + + 2008 Redistributable Package (x86)
Download Address: Http://download.microsoft.com/download/7/5/0/7502f4e9-1f90-4895-9259-1bde67b8b9a1/vcredist_x86.exe
PHP5.2 Download Address: Http://museum.php.net/php5/php-5.2.17-Win32.zip ( Note: php5.2 no vc9)
PHP v5.2.17 is not thread safe (Non Thead safe) for Windows (Fastcig run) http://www.jb51.net/softs/268745.html
The above concerns the version of PHP 5.2 and the choice of non-thread safe version of the issue, you can according to the following statement, select a, personal recommended use fastcgi format, Microsoft specifically used to improve the efficiency of PHP implementation, certainly the need for hard disk is also slightly larger.
I have used, fastcgi thread to open a number of unreasonable, resulting in the memory of the hurricane, ISAPI is a single thread, memory footprint only one.
Too much memory usage will definitely affect server efficiency.
Of course, if your memory is big enough, certainly choose fastcgi, memory is not much, certainly select ISAPI.
Configuration Chapter
First, PHP installation
1, fastcgi module support.
Windows 2008r2 IIS7.5 and fastcgi, which is very different from IIS6.0, IIS6.0 need to install fastcgi themselves. IIS7.5 has been integrated with the FastCGI module, so as long as the installation of the CGI module, as long as the check, Can be installed on the fastcgi
2. Install Visual C + + 2008 X64 Run Library
3, decompression Php-5.2.17-win32.zip, rename folder for PHP, and copy to C packing directory;
4, set fastcgi Related:
Find the following lines, put the front of the ";" Remove
Fastcgi.impersonate = 1
Cgi.fix_pathinfo= 1
Cgi.force_redirect = 0
5, rename the php.ini-recommended to php.ini, and modify the configuration file.
Note: After PHP, when configured, there will be two php.ini:php.ini-dist and php.ini-recommended,php.ini-recommended security levels higher than the php.ini-dist. The default is to set Display_errors to off, set MAGIC_QUOTES_GPC to off, and so on. The relative php.ini-dist are all the default configurations. If you just want to do web testing and general development, use Php.ini-dist, or use php.ini-recommended.
Open php.ini with Notepad
Make the following modifications:
Extension_dir = "C:\php\ext" #设置php模块路径
Upload_tmp_dir= "C:\php\tmp" #临时文件夹路径, this directory can be set in other places, but must have readable, writable, modifiable permissions.
Date.timezone = PRC #设置时区为中国时区
Register_globals = on #开启GET数据调用
Short_open_tag = on #php支持短标签
Extension=php_curl.dll
Extension=php_gd2.dll
Extension=php_gettext.dll
Extension=php_ldap.dll
Extension=php_mbstring.dll
Extension=php_exif.dll
Extension=php_mysql.dll
Extension=php_mysqli.dll
Extension=php_sockets.dll
Extension=php_xmlrpc.dll
Extension=php_mcrypt.dll
Extension=php_mhash.dll
#将以上常用组件前面的 ";" Remove.
The PHP manual used to advocate copying files to the Windows system directory because the directory (C:\WINDOWS,C:\WINNT, etc.) is in the system path by default. But the way in which files are copied to the Windows system directory has long been discouraged and may cause problems.
Recommendation: Add the PHP directory to Windows path; start à control Panel à system à advanced system settings à select the Advanced tab à click the "Environment variable" button and in the System Variables column, click to find Path, and then double-click the path item to add your PHP directory at the end ( For example:; C:\php) "There is a" in front of the C disk; "Click OK and restart the computer."
Click Win-m5qlsha7q3g on the left and select the ISAPI filter to work with the PHP configuration.
Second, IIS7.5 configuration fastcgi
1, open IIS Manager, find: "Handler mapping", open the following figure, click "Add Module Mapping";
2, after filling out click OK, and in the Pop-up confirmation dialog box select "Yes", the configuration ended.
3, to the IIS functional view, find: "FastCGI settings", open and according to the map operation confirmed;
4, modify factcgi settings
Monitoring changes to files: "C:\php\php-cgi.exe" #该值的意思是发送多少个请求后会重启该线程, we need to reduce this value appropriately to allow PHP-FPM to automatically free up memory
environment variable, click Next to install, point "add"
Name:php_fcgi_max_requests
value:10000 #指定文件路径, if this file is changed, FastCGI process recycling will be triggered
5, testing
Part of the site resources collected in the network, pure personal collection, no commercial use, such as infringement, please inform!