关于配置FastCGI中的一些错误
成功志
关于配置FastCGI中的一些错误
2012-8-29 ok12

关于配置FastCGI中的一些错误




在配置FastCGI的时候中间我也遇见很多错误,下面是我的记录:


我第一次安装时,运行的安装代码


cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:\Program Files\PHP\php-cgi.exe"


则显示了


C:\WINDOWS\system32\inetsrv\fcgiconfig.js(1326, 5) (null): Section already exists, section=PHP


可能是由于为了服务器的安全我的安装系统删除了wsshell命令,导致在执行时出现了错误


Microsoft JScript 运行时错误: Automation 服务器不能创建对象

解决办法:重新注册命令:regsvr32 WSHom.ocx 更多关于IIS组件安装与卸载


————————————————————————————————————————————————


一运行测试页面就显示500错误


j解决方法:


打开IE----INTERNET选项--------高级------------显示友好的HTTP错误前面的勾去掉,再出现错误的时候会提示你错误的具体提示。


提示:


PHP Warning: Unknown: open(c:\php\upload_tmp\sess_li3ardp5qtalfj4, O_RDWR) failed: Permission denied (13) in Unknown on line 0 PHP Warning:


Unknown: open(c:\php\upload_tmp\sess_li3ardbp5qtalfj4, O_RDWR) failed: Permission denied (13) in Unknown on line 0 PHP Warning: Unknown: Failed


to write session data (files). Please verify that the current setting of session.save_path is correct (c:\php\upload_tmp) in Unknown on line 0

这说明我没有给c:\php\upload_tmp写入权限,给了.写入权限,解决!


———————————————————————————————————————————————————


收集的问题:


Q1:

重启IIS后,打开测试页出现如下提示:


FastCGI Error

The FastCGI Handler was unable to process the request.

--------------------------------------------------------------------------------


Error Details:


Error Number: 5 (0x80070005).

Error Description: 拒绝访问。

HTTP Error 500 - Server Error.

Internet Information Services (IIS)


这个错误是由于在解压PHP之后,没有对IIS启动帐户赋予该目录的读取和运行权限.修改文件夹安全属性,问题解决.




Q2:

在写php程序中有时会出现这样的警告:PHP Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in D:/PHPWEB/news/file.php on line 17 。这是因为PHP所取的时间是格林威治标准时间,所以和你当地的时间会有出入格林威治标准时间和北京时间大概差8个小时左右,我们可以按照下面的方法解决:


1、在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即


< ?php


date_default_timezone_set("PRC");


?>就可以了。


2、在php.ini中设置date.timezone的值为PRC,设置好以后的为:date.timezone=PRC,同时取消这一行代码的注释,即去掉前面的分号就可以了。


Q3:

还遇到一个问题,就是运行时,页面显示空白,或者无法显示(404),请检查主目录中的php文件名映射,删除,重新添加一个默认的即可


 


还有一种问题,如下:


FastCGI Error

The FastCGI Handler was unable to process the request.

--------------------------------------------------------------------------------

Error Details:

Could not find entry for "php" on site 2043809562 in [Types]section.

Error Number: 1413 (0x80070585).

Error Description: 无效索引。

HTTP Error 500 - Server Error.

Internet Information Services (IIS)

这个错误我就没处理过了,后来找到了这个页面:http://forums.iis.net/t/1146956.aspx,知道原来FastCGI也有配置文件的,文件名:

C:\WINDOWS\system32\inetsrv\fcgiext.ini

我的服务器出现这个错误,是因为微软Web平台配置程序没有正确配置这个文件,正确的配置应该如下:

[Types]

php=PHP

[PHP]

ExePath=C:\Program Files\PHP\php-cgi.exe

InstanceMaxRequests=10000

ActivityTimeout=300

RequestTimeout=600

EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:C:\ProgramFiles\PHP\

这样配置之后,PHP程序就可以正常运作啦!

顺便说一句,微软Web平台安装FastCGI时,会自动选择合适的PHP版本(32位或64位),不需要人工去区别了


 




-我按以上问题处理流程处理,问题依旧,因此我将 ExePath=C:\Program Files\PHP\php-cgi.exe 这句(我的是d:/php53/php-cgi.exe) 将 ” / “ 改成 ” \ “ 即可




 


 


错误1,

FastCGI Error

The FastCGI Handler was unable to process the request.

Error Details:

The FastCGI process exited unexpectedly

Error Number: -2147467259 (0x80004005).

Error Description: 未指定的错误

HTTP Error 500 - Server Error.

Internet Information Services (IIS)


    搜索: register_globals = Off (约第705行)

将Off更改为 On,该行的注释符,即前面的分号”;”去掉,使该行在php.ini文档中起作用,即得到 register_globals = On ;

注:这个对于PHP的全局变量功能,考虑有很多PHP程序需要全局变量功能所以打开,打开后请注意PHP程序的严谨性,如果不需要全局变量功能,或者出错,请保持默认Off状态。    


错误2,

fastcgi error

the fastcgi handler was unable to process the request.

--------------------------------------------------------------------------------

error details:

error number: 5 (0x80070005).

error description: 拒绝访问。

http error 500 - server error.

internet information services (iis)

这个错误是由于在解压php之后,没有对iis启动帐户赋予该目录的读取和运行权限.修改文件夹安全属性,问题解决.


错误3,

FastCGI Error

The FastCGI Handler was unable to process the request.

--------------------------------------------------------------------------------

Error Details:

Could not find entry for "php" on site 1960240566 in [Types] section.

Error Number: 1413 (0x80070585).

Error Description: 未指定的错误

HTTP Error 500 - Server Error.

Internet Information Services (IIS)


即说明没有安装成功!请按照fcgiext.ini 修改配置即可!!


错误4,

----------

FastCGI Error


The FastCGI Handler was unable to process the request.


Error Details:


The FastCGI process exited unexpectedly

Error Number: -1073741819 (0xc0000005).

Error Description: Unknown Error

HTTP Error 500 - Server Error.

Internet Information Services (IIS)

--------

我的PHP目录在C盘

当时配置PHP.INI的时候就在那个安装目录编辑好,再复制到windows目录下的...

结果恰恰是C:\PHP\php.ini 这个"备份"文件的存在 干扰了FastCGI的运行,总是提示我。

把 C:\php\php.ini 删除,搞定!


随后用FakeCGI调试工具才搞定原因..

感谢FakeCGI,痛斥我的坏习惯!!!

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容