iis5.1下FASTCGI方式运行PHP(Windows XP 搭建php环境)
方文档:Using FastCGI to Host PHP Applications on IIS 6.0:http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/
其他帮助:
IIS + FastCGI + PHP5.3 + MySQL5.1 + Gzip 详细配置图文教程: http://wenku.baidu.com/view/6c8bab18964bcf84b9d57bc3.html
在IIS 5.1 或IIS6 中配置PHP 的FastCGI模式:http://www.pqshow.com/design/jiqiao/200909/10159.html
准备工作:
下载:FastCGI 1.5 for IIS 6 and 5.1
http://www.iis.net/extensions/fastcgi
下载:php 5.35(Non Thread Safe 版本)
http://windows.php.net/downloads/releases/php-5.3.5-nts-Win32-VC9-x86.zip(需要vc9运行库支持)
1.安装iis5.1的fastcgi扩展,运行web平台安装程序(就是FastCGI 1.5 for IIS 6 and 5.1),一路默认,下一步即可。
2.配置php,将php解压到 E:\Program Files\php 下
将 E:\Program Files\php\php.ini-recommended 复制一个,然后重命名为 D:\PHP\php.ini
打开php.ini,修改默认为:
extension_dir = " E:\Program Files\php\ext"
fastcgi.impersonate = 1
date.timezone = PRC
记得去掉上面几项前面的 ; 号
3.在IIS 5.1 中配置PHP 的FastCGI模式
编辑 C:\WINDOWS\system32\inetsrv\fcgiext.ini,
在最后加入
php=PHP
ExePath=E:\Program Files\PHP\php-cgi.exe
InstanceMaxRequests=10000
ActivityTimeout=300
RequestTimeout=600
EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:E:\Program Files\PHP\
注:这里是E:\Program Files\PHP\, 到时候要根据自己解压时的路径配置
在虚拟目录依旧照此配置
4.运行测试
新建info.php
<?php phpinfo();?>
在IIS中浏览之,显示下面的画面就表示搭建成功了。
常见问题解决方案:
FastCGI Error
The FastCGI Handler was unable to process the request.
--------------------------------------------------------------------------------
Error Details:
Could not find entry for "php" on site 1 in section.
Error Number: 1413 (0x80070585).
Error Description: 无效索引。
HTTP Error 500 - Server Error.
Internet Information Services (IIS)
C:\WINDOWS\system32\inetsrv\fcgiext.ini
出现这个错误是因为C:\WINDOWS\system32\inetsrv\fcgiext.ini,正确的配置上面已经提到
=============================================================================================
FastCGI Error
The FastCGI Handler was unable to process the request.
--------------------------------------------------------------------------------
Error Details:
•Error Number: 14001 (0x800736b1).
•Error Description: 由于应用程序配置不正确,应用程序未能启动。重新安装应用程序可能会纠正这个问题。
HTTP Error 500 - Server Error.
Internet Information Services (IIS)
原因是这个版本的php是vc9编译的,系统需要vc9支持,而自己的系统可能没装,安装Vc9运行库即可。
下载地址:
http://xiazai.xiazaiba.com/Soft/V/vcredist2008_SP1_x86_XiaZAiBa.zip
为了您的安全,请只打开来源可靠的网址
打开网站 取消
来自: http://hi.baidu.com/h4cktheworld/blog/item/ee55cff459c5d291b801a005.html
页:
[1]