<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[静怡家园]]></title> 
<link>http://www.zhanghaijun.com/index.php</link> 
<description><![CDATA[书山有路勤为径，学海无涯苦作舟！]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[静怡家园]]></copyright>
<item>
<link>http://www.zhanghaijun.com/post//</link>
<title><![CDATA[IIS6使用FastCGI方式加载PHP5]]></title> 
<author>碟舞飞扬 &lt;webmaster@zhanghaijun.com&gt;</author>
<category><![CDATA[服务器类]]></category>
<pubDate>Mon, 23 Feb 2009 15:15:12 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//</guid> 
<description>
<![CDATA[ 
	在IIS6上使用FastCGI PHP5(应该是目前Win性能最好的PHP支持方法) <br/>1.下载FastCGI For IIS6 <br/>http://www.microsoft.com/downloads/details.aspx?FamilyID=2d481579-9a7c-4632-b6e6-dee9097f9dc5&displaylang=en<br/>下载之后,双击运行进行安装即可. 安装后C:&#92;WINDOWS&#92;system32&#92;inetsrv目录下有这几个文件<br/><a href="http://www.zhanghaijun.com/attachment/month_0902/22009223231137.jpg" target="_blank"><img src="http://www.zhanghaijun.com/attachment/month_0902/22009223231137.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>2、下载PHP5免安装版本，<br/>http://www.php.net/downloads<br/>解压到C:&#92;PHP目录下<br/>要确保IIS启动帐号对C:&#92;PHP&#92;*有读取执行权限<br/>3、注册PHP到FastCGI<br/>cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:&#92;PHP&#92;php-cgi.exe"<br/>4、做一些性能和安全设置<br/>C:&#92;PHP&#92;php.ini-recommended重命名为为C:&#92;PHP&#92;php.ini<br/>打开C:&#92;PHP&#92;php.ini，修改：<br/>extension_dir = "C:&#92;PHP&#92;ext"<br/>fastcgi.impersonate = 1<br/>cgi.fix_pathinfo=1<br/>cgi.force_redirect = 0<br/>执行：<br/>cscript fcgiconfig.js -set -section:"PHP" -InstanceMaxRequests:10000<br/>cscript fcgiconfig.js -set -section:"PHP" -EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000<br/>以上两项设置最大池和响应连接数，可以根据自己的硬件配置、使用情况修改<br/><br/>5：配置 IIS & PHP <br/>开始，运行，inetmgr依次展开，选中要配置的站点，右键，属性。切换到“主目录”选项卡，“配置”，“添加”，“浏览” 选中 C:&#92;WINDOWS&#92;system32&#92;inetsrv&#92;fcgiext.dll ，“确定”扩展名填入“.php”，勾选“脚本引擎”及“检查文件是否存在”，确定。 <br/><a href="http://www.zhanghaijun.com/attachment/month_0902/k2009223231445.jpg" target="_blank"><img src="http://www.zhanghaijun.com/attachment/month_0902/k2009223231445.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>一切完毕之后重启IIS,赶紧写一个测试页试一下吧. <br/>重启IIS后,打开测试页出现如下提示: <br/>FastCGI Error <br/>The FastCGI Handler was unable to process the request. <br/>-------------------------------------------------------------------------------- <br/>Error Details: <br/>Error Number: 5 (0x80070005). <br/>Error Description: 拒绝访问。 <br/>HTTP Error 500 - Server Error. <br/>Internet Information Services (IIS) <br/>这个错误是由于在解压PHP之后,没有对IIS启动帐户赋予该目录的读取和运行权限.修改文件夹安全属性,问题可以解决.<br/>第二种简单的方法就是：<br/>打开C:&#92;WINDOWS&#92;system32&#92;inetsrv&#92;fcgiext.ini 在[Types]下面加上下面这几行<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">php=PHP<br/>[PHP]<br/>ExePath=C:&#92;php&#92;php-cgi.exe<br/>InstanceMaxRequests=500<br/>EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000</div></div><br/><a href="http://www.zhanghaijun.com/attachment/month_0902/b2009223231358.jpg" target="_blank"><img src="http://www.zhanghaijun.com/attachment/month_0902/b2009223231358.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>如果你的系统是windows server 2003 SP2的话安装好FastCGI之后WEB服务扩展里面就有FastCGI Handler的扩展了，<br/><a href="http://www.zhanghaijun.com/attachment/month_0902/0200922323139.jpg" target="_blank"><img src="http://www.zhanghaijun.com/attachment/month_0902/0200922323139.jpg" class="insertimage" alt="点击在新窗口中浏览此图片" title="点击在新窗口中浏览此图片" border="0"/></a><br/>在你把上面的几行保存到fcgiext.ini之后，重启IIS就可以了，ISAPI扩展不用你添加就自动添加好了。<br/>Tags - <a href="http://www.zhanghaijun.com/tags/iis6/" rel="tag">iis6</a> , <a href="http://www.zhanghaijun.com/tags/fastcgi/" rel="tag">fastcgi</a> , <a href="http://www.zhanghaijun.com/tags/php5/" rel="tag">php5</a>
]]>
</description>
</item><item>
<link>http://www.zhanghaijun.com/post//#blogcomment</link>
<title><![CDATA[[评论] IIS6使用FastCGI方式加载PHP5]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.zhanghaijun.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>