apache FastCGI: comm with server 是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/373027/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does FastCGI: comm with server mean?
提问by Aaron Longwell
I'm getting this error in a PHP (Drupal) application:
我在 PHP (Drupal) 应用程序中收到此错误:
(104)Connection reset by peer: FastCGI: comm with server "/opt/php-5.2.5/bin/php-cgi" aborted: read failed
It is often followed by this error:
后面经常出现这个错误:
FastCGI: incomplete headers (0 bytes) received from server "/opt/php-5.2.5/bin/php-cgi"
The basic Apache configuration for PHP looks like this:
PHP 的基本 Apache 配置如下所示:
FastCgiServer /opt/php-5.2.5/bin/php-cgi -initial-env PHP_FCGI_CHILDREN=32
ScriptAlias /fcgi-bin/php-5.2.5 /opt/php-5.2.5/bin/php-cgi
<Location /fcgi-bin/php-5.2.5>
Options +ExecCGI
SetHandler fastcgi-script
SetOutputFilter INCLUDES
</Location>
# send php5.2-fastcgi handler to our scriptalias
Action php-5.2.5-fastcgi /fcgi-bin/php-5.2.5
Now, my basic question is, what are the general causes of the "comm with server" error? In this particular case, the error appears intermittently, but certain pages generate it more often than others. I'd like to know what to look for when debugging my code.
现在,我的基本问题是,“与服务器通信”错误的一般原因是什么?在这种特殊情况下,错误会间歇性地出现,但某些页面比其他页面更频繁地生成它。我想知道在调试我的代码时要寻找什么。
回答by Aaron Longwell
In this particular issue, it was related to an odd bug in my code... it seems certain kinds of errors cause FastCGI to fail so badly that it doesn't forward on the underlying PHP code error. Sorry I don't have more detail for those of you visiting from Google.
在这个特定的问题中,它与我的代码中的一个奇怪的错误有关......似乎某些类型的错误导致 FastCGI 失败得如此严重,以至于它不会转发底层的 PHP 代码错误。抱歉,对于从 Google 访问的人,我没有更多详细信息。
回答by Leandro Ardissone
回答by Yuriy
Sometimes it helps.
output.buffering = 1into your php.ini file
有时它有帮助。
output.buffering = 1进入你的 php.ini 文件
回答by workflow
回答by sacabuche
I had the same problem but in python and i resolved changing the extention of my script to .py
我遇到了同样的问题,但在 python 中,我解决了将脚本的扩展名更改为 .py
#.htaccess file
AddHandler fastcgi-script .py

