windows 2008 iis中使用php
准备工作
下载php5.2.8 并解压到如c:/php
把c:/php加入系统环境变量 path中
1、在iis中增加cgi服务(通过控制面板=>程序=》增加角色服务)
2、iis 中可以看到 CGI了
3、在应用程序映射中,增加“模板映射” 依次填入 *.php,e:/php/php-cgi.exe,fastCGIModule(选择)
4、把php文件放入站点
5、运行
6、出现 FastCGI 进程超过了配置的活动超时时限
7、在下列文件( C:/Windows/System32/inetsrv/config/applicationHost.config)中加入
<fastCgi>
<application fullPath="E:/appJar/php/php-cgi.exe" activityTimeout="600" />
</fastCgi>
activityTimeout="600" 是关键
8、注意:此时站点的Web.config文件中已经增加了
<system.webServer>
<handlers>
<add name="Php-FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="E:/appJar/php/php-cgi.exe" resourceType="Unspecified" />
</handlers>
</system.webServer>
9以下是通过命令的方式增加 activityTimeout="600"到文件 C:/Windows/System32/inetsrv/config/applicationHost.config中
%windir%/system32/inetsrv/appcmd set config "www.winfang.com" -section:system.webServer/fastCgi /[fullPath='e:/php/php-cgi.exe'].activityTimeout:600