首页 > 软件下载 > 软件下载

Windows2003+IIS7 Express使用FastCgi运行php

2023-08-09

资源介绍

1、先修改:defaultDocument节,加入 <add value="index.php" />
<defaultDocument enabled="true">
<files>
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
<add value="iisstart.htm" />
<add value="default.aspx" />
<add value="index.php" />
</files>
</defaultDocument>

2、找到fastcgi节。
<fastCgi>
<application fullPath="C:\php\php-cgi.exe" monitorChangesTo="php.ini" activityTimeout="600" requestTimeout="600" instanceMaxRequests="10000">
<environmentVariables>
<environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
<environmentVariable name="PHPRC" value="C:Program Files (x86)iis expressPHPv5.4" />
</environmentVariables>
</application>
</fastCgi>

3、找到handlles,加入
<add name="PHP_FastCGI" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe" resourceType="Either" />
尤其要注意的一是,这一句最好加在最前面,也就是在<handlles>下面的第一句,避免被其它Handle抢先处理了。

以上配置中,C:\php\php-cgi.exe 的部分替换成自己的php文件夹中的php-cgi.exe的位置。

4、在<site>配置节下,直接修改站点信息,或直接用appcmd.exe add site来添加站点。

5、找到诸如wordpress的安装文件夹,创建一个web.config文件,在configuration配置节下,添加Gzip压缩规则。
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>

6、同样在web.config中,Wordpress的rewrite完整的web.config文件内容如下:

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>
</configuration>

这样就完全配置完毕了,然后在IIS7 Express目录下,找到IISExpress.exe,直接双击运行,或者用命令行来执行指定加载哪个站点.
iisexpress.exe /site:'站点名称1"
iisexpress.exe /site:'站点名称2"

展开全部

版权声明

1 本站所有资源(含游戏)均是软件作者、开发商投稿,任何涉及商业盈利目的均不得使用,否则产生的一切后果将由您自己承担!

2 本站资源下载后不得用于商业用途,所有资源请在下载后24小时内删除。

3 若有关在线投稿、无法下载等问题,请与本站客服人员联系。

4 如侵犯了您的版权、商标等,请立刻联系我们并具体说明情况后,本站将尽快处理删除,联系QQ:2499894784

最近更新

热门排行

最需网客户端 软件问题一手掌握

去 App Store 免费下载 iOS 客户端