fastcgi-script的处理程序返回了无效的结果代码 [英] Handler for fastcgi-script returned invalid result code

查看:120
本文介绍了fastcgi-script的处理程序返回了无效的结果代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对连接到SOAP 1.2 + WSDL服务的PHP应用有一个奇怪的问题:



先前的信息:带有php5-fcgi模块的Apache服务器2.4。
我正在为SOAP服务的客户端工作,我可以对服务进行一些请求。



该请求花了一些时间才能完成。我需要执行set_time_limit(60),因为如果我没有它,脚本将返回空闲超时错误:


FastCGI :与服务器 / usr / lib / cgi-bin / php5-fcgi的通信已中止:空闲
超时(30秒)


使用set_time_limit,我又遇到另一个错误:


AH00524:fastcgi-script的处理程序返回了无效的结果代码1


这些错误在我尝试执行SOAP请求时出现。没有它,该页面就可以正常工作。



在日志中出现此错误后,我在导航器上遇到了另一个不同的错误。在IE上,该页面无法加载,Firefox显示 Content Encoding Error页面。



如果我尝试在屏幕上显示SOAP连接结果(带有

尝试搜索内容编码错误,并且,如果我尝试执行请求但未将其发送到屏幕上,我找到了一些有关压缩的信息。我尝试在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)。



同一页,经过测试在HTTP和HTTPS上使用Apache2不能正常工作(错误在顶部描述)。然后,我尝试使用Nginx(相同的webroot,理论上相同的php5-fcgi配置)输入,然后正常运行。



谢谢,

解决方案

在大多数情况下,使用fastCGI时,空闲超时错误是由CGI请求导致的,该时间长于使用idle-timeout参数设置的时间。如果未设置,则默认值为30秒。



来自 mod_fastcgi文档


-idle-timeout n(30秒)
在中止请求并记录事件之前,允许FastCGI应用程序不活动的秒数(错误
LogLevel)。仅当连接
与FastCGI应用程序处于挂起状态时,不活动计时器才适用。如果将请求排队到
应用程序中,但该应用程序在这段时间内没有响应(通过写入和
刷新),则该请求将被中止。如果
与应用程序的通信已完成但与
客户端的通信不完整(响应被缓冲),则超时不适用。


在日志文件中,您可以看到以下内容:

  [fastcgi:error] FastCGI:与服务器通信 / var / www / bin / php-fastcgi中止:空闲超时(30秒),引荐来源:http://example.org/script.php 

然后在网络浏览器中,收到内容编码错误消息。



为避免此错误,有可能来增加fastCGI配置中的空闲超时。

  FastCgiConfig -idle-timeout 900 

因此,通过增加空闲超时时间,您不再需要使用set_time_limit。


I have a strange question with PHP app connecting to a SOAP 1.2+WSDL service:

Previous information: Apache server 2.4 with php5-fcgi module. I'm working on a client for a SOAP service, and I can do some request for the service.

The request took some time to complete. I've needed to do a set_time_limit(60) because if I doesn't have it, the script return idle timeout error:

FastCGI: comm with server "/usr/lib/cgi-bin/php5-fcgi" aborted: idle timeout (30 sec)

With set_time_limit, i got another different error:

AH00524: Handler for fastcgi-script returned invalid result code 1

These error appears when I try to do the SOAP request. Without it, the page works OK.

With this error on log, I have another different error on navigator. On IE, the page doesn't load, Firefox show "Content Encoding Error" page.

These error appears if I try to show on screen the SOAP connection result (with a var_dump), and, also, if I try to do the request but doesn't send it to screen.

Trying to search for the "Content Encoding Error", I've find something about compression. I've tried to do "ob_start" before and after set_time_limit, but, when I try to do it, I get an timeout error at log (I think PHP doesn't make the timeout change), and, also, the page shows an 500 internal server error.

What's the problem? The only option I think can be getting these problem are some timeout between Apache and php5-fcgi module, but I doesn't know how to modify this for trying another option.


EDIT:

I have two servers on the same machine, Apache2 (2.4.10) + php5-fcgi (5.6.2) (HTTP port 80, HTTPS port 443), and Nginx (1.6.2) + php5-fcgi (HTTP port 8080).

The same page, tested with Apache2 does not work (Error described at top), on HTTP and HTTPS. Then, I try to enter with Nginx (Same webroot, theoretically same php5-fcgi config), and then, running properly.

Thanks,

解决方案

Most of the times idle timeout error when you use fastCGI is caused by a CGI request longer than the time set up with idle-timeout parameter. If not set up, the default is 30 sec.

From the mod_fastcgi documentation:

-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.

In log files you can see something like this:

[fastcgi:error] FastCGI: comm with server "/var/www/bin/php-fastcgi" aborted: idle timeout (30 sec), referer: http://example.org/script.php

And in a web browser yoy get the "Content Encoding Error" message.

To avoid this error it is possible to increase the idle timeout in fastCGI configuration.

FastCgiConfig -idle-timeout 900

So, by increasing idle timeout you don't need to use set_time_limit anymore.

这篇关于fastcgi-script的处理程序返回了无效的结果代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆