fastcgi 脚本的处理程序返回了无效的结果代码
Handler for fastcgi-script returned invalid result code
我对连接到 SOAP 1.2+WSDL 服务的 PHP 应用有一个奇怪的问题:
以前的信息:带有 php5-fcgi 模块的 Apache 服务器 2.4。
我正在为 SOAP 服务开发客户端,我可以为该服务做一些请求。
请求需要一些时间才能完成。我需要做一个 set_time_limit(60) 因为如果我没有它,脚本 return 空闲超时错误:
FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle
timeout (30 sec)
使用 set_time_limit,我得到另一个不同的错误:
AH00524: Handler for fastcgi-script returned invalid result code 1
当我尝试执行 SOAP 请求时出现这些错误。没有它,页面工作正常。
由于日志中出现此错误,我在导航器上出现了另一个不同的错误。在 IE 上,页面未加载,Firefox 显示 "Content Encoding Error" 页面。
如果我尝试在屏幕上显示 SOAP 连接结果(使用 var_dump),以及如果我尝试执行请求但未将其发送到屏幕,则会出现这些错误。
尝试搜索 "Content Encoding Error",我找到了有关压缩的信息。我尝试在 set_time_limit 之前和之后执行 "ob_start",但是,当我尝试这样做时,我在日志中收到超时错误(我认为 PHP 不会超时更改),并且该页面还显示 500 内部服务器错误。
有什么问题吗?我认为可能导致这些问题的唯一选择是 Apache 和 php5-fcgi 模块之间的一些超时,但我不知道如何修改它以尝试另一个选项。
编辑:
我在同一台机器上有两台服务器,Apache2(2.4.10)+ php5-fcgi(5.6.2)(HTTP端口80,HTTPS端口443),Nginx(1.6.2) + php5-fcgi (HTTP 端口 8080).
使用 Apache2 测试的同一页面在 HTTP 和 HTTPS 上不起作用(顶部描述的错误)。然后,我尝试使用Nginx(相同的webroot,理论上相同的php5-fcgi配置)进入,然后,运行正确。
谢谢,
大多数情况下使用fastCGI 时出现idle timeout 错误是因为CGI 请求比idle-timeout 参数设置的时间长。如果不设置,默认为30秒
-idle-timeout n (30 seconds)
The number of seconds of FastCGI application inactivity allowed before the request is aborted and the event is logged (at the error
LogLevel). The inactivity timer applies only as long as a connection
is pending with the FastCGI application. If a request is queued to an
application, but the application doesn't respond (by writing and
flushing) within this period, the request will be aborted. If
communication is complete with the application but incomplete with the
client (the response is buffered), the timeout does not apply.
在日志文件中,您可以看到类似这样的内容:
[fastcgi:error] FastCGI: comm with server "/var/www/bin/php-fastcgi" aborted: idle timeout (30 sec), referer: http://example.org/script.php
然后在网络浏览器中收到 "Content Encoding Error" 消息。
为避免此错误,可以增加 fastCGI 配置中的空闲超时。
FastCgiConfig -idle-timeout 900
因此,通过增加空闲超时,您不再需要使用 set_time_limit。
我对连接到 SOAP 1.2+WSDL 服务的 PHP 应用有一个奇怪的问题:
以前的信息:带有 php5-fcgi 模块的 Apache 服务器 2.4。 我正在为 SOAP 服务开发客户端,我可以为该服务做一些请求。
请求需要一些时间才能完成。我需要做一个 set_time_limit(60) 因为如果我没有它,脚本 return 空闲超时错误:
FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)
使用 set_time_limit,我得到另一个不同的错误:
AH00524: Handler for fastcgi-script returned invalid result code 1
当我尝试执行 SOAP 请求时出现这些错误。没有它,页面工作正常。
由于日志中出现此错误,我在导航器上出现了另一个不同的错误。在 IE 上,页面未加载,Firefox 显示 "Content Encoding Error" 页面。
如果我尝试在屏幕上显示 SOAP 连接结果(使用 var_dump),以及如果我尝试执行请求但未将其发送到屏幕,则会出现这些错误。
尝试搜索 "Content Encoding Error",我找到了有关压缩的信息。我尝试在 set_time_limit 之前和之后执行 "ob_start",但是,当我尝试这样做时,我在日志中收到超时错误(我认为 PHP 不会超时更改),并且该页面还显示 500 内部服务器错误。
有什么问题吗?我认为可能导致这些问题的唯一选择是 Apache 和 php5-fcgi 模块之间的一些超时,但我不知道如何修改它以尝试另一个选项。
编辑:
我在同一台机器上有两台服务器,Apache2(2.4.10)+ php5-fcgi(5.6.2)(HTTP端口80,HTTPS端口443),Nginx(1.6.2) + php5-fcgi (HTTP 端口 8080).
使用 Apache2 测试的同一页面在 HTTP 和 HTTPS 上不起作用(顶部描述的错误)。然后,我尝试使用Nginx(相同的webroot,理论上相同的php5-fcgi配置)进入,然后,运行正确。
谢谢,
大多数情况下使用fastCGI 时出现idle timeout 错误是因为CGI 请求比idle-timeout 参数设置的时间长。如果不设置,默认为30秒
-idle-timeout n (30 seconds) The number of seconds of FastCGI application inactivity allowed before the request is aborted and the event is logged (at the error LogLevel). The inactivity timer applies only as long as a connection is pending with the FastCGI application. If a request is queued to an application, but the application doesn't respond (by writing and flushing) within this period, the request will be aborted. If communication is complete with the application but incomplete with the client (the response is buffered), the timeout does not apply.
在日志文件中,您可以看到类似这样的内容:
[fastcgi:error] FastCGI: comm with server "/var/www/bin/php-fastcgi" aborted: idle timeout (30 sec), referer: http://example.org/script.php
然后在网络浏览器中收到 "Content Encoding Error" 消息。
为避免此错误,可以增加 fastCGI 配置中的空闲超时。
FastCgiConfig -idle-timeout 900
因此,通过增加空闲超时,您不再需要使用 set_time_limit。