IIS6+PHP5.3.2配置
在windows下使用Apache+PHP的,请选择VC6版本
windows下使用IIS+PHP的,请选择VC9版本
首先要知道的是,那个服务器平台对应PHP那个版本:
1。在windows下使用Apache+PHP的,请选择VC6版本;
2。在windows下使用IIS+PHP的,请选择VC9版本;
第一部分:IIS6+PHP5.3
1.下载 FastCGI For IIS6
第一部分:IIS6+PHP5.3
1.下载 FastCGI For IIS6
http://www.iis.net/expand/fastcgi
打开页面后点右边 download x86 / x64 看看你服务器选择下载
下载之后,双击运行进行安装。
安装后在 C:\WINDOWS\system32\inetsrv 目录下产生了五个文件。如下图:

同时在 IIS 的 “Web 服务扩展”里多了 FastCGI Handler

2.下载 PHP5.3 Windows 版
http://www.php.net/downloads.php
下载 .zip 格式的版本,下载后解压至 D:\PHP 目录,并给 IIS 启动帐户组或用户赋予读取和运行权限。如下图:

3. 注册 PHP 到 FastCGI
打开 C:\WINDOWS\system32\inetsrv\fcgiext.ini 文件。
; This is the configuration file for the FastCGI handler for IIS 6.0.
; The FastCGI handler will look for this file in the same directory as
; fcgiext.dll. By default, the FastCGI installer will place this file into
; the %windir%\system32\inetsrv directory.
我个人的理解是,只要“Web 服务扩展”里的 FastCGI Handler 为允许时,在加载 fcgiext.dll 时,会读取 fcgiext.ini 配置文件的内容,根据里面的配置为每个网站提供映射。
在 [Types] 下添加以下配置:
[Types]
php=PHP
[PHP]
ExePath=D:\PHP\php-cgi.exe
“php”表示扩展名,“PHP”是配置节名称,以“[PHP]”定义。
4. 配置 php.ini
将 D:\PHP\php.ini-production 复制一个,然后重命名为 D:\PHP\php.ini
打开 D:\PHP\php.ini,
修改PHP.ini文件:
1。第531行改为:display_errors = On
2。第542行改为:display_startup_errors = On
3。第624行改为:error_prepend_string = "<br><font color=#ff0000>"
4。第630行改为:error_append_string = "</font><br><br>"
5。第813行改为:extension_dir = "D:\php\php_setup_files\php-5.3-vc9\ext\"
6。第854行改为:fastcgi.impersonate = 1
7。从948行到988行根据自己的需要修改
8。第997行改为:date.timezone = asia/Shanghai
其它的根据实际需要对 php.ini 进行设置修改,这里只针对能跑 php,修改完记得重启 IIS。
5. 配置网站
右键网站 => 属性 => 主目录 => 配置 => 添加,如下图配置:

可执行文件路径:C:\WINDOWS\system32\inetsrv\fcgiext.dl
6. 写个 php 测试下吧
<?php
phpinfo();
?>
PHP目录权限:IWAM_机器名称(和上图中并没有影响,感觉它的权限更小些,但两种权限都能正常运行)
错误信息:
1。Error Number: 14001 (0x800736b1).
没有安装Microsoft Visual C++ 2008 Redistributable Package
下载地址:http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=zh-cn
2。Error Number: 5 (0x80070005).
Unable to place a FastCGI process in a JobObject. Try disable the Application Pool CPU Limit feature
取消CPU的监视
3。No input file specified.
估计是没配置 fastcgi.impersonate。
转载说明:更多精彩文章来自:No.1网络
原载: No.1网络工作室 http://www.noonenet.cn/