500 服务器错误:脚本头过早结束: [英] 500 Server error: Premature end of script headers:
问题描述
我有一个使用 solr 索引服务器的 php 网站,基于 CodeIgniter.
I have a website in php that works with a solr indexation server, based on CodeIgniter.
我们得到了很多新内容,所以我们刷新了数据库,并且不得不重新索引内容(大约 168,000 个元素).我创建了一个脚本来按 500 个切片对内容进行索引 - 脚本完成后,我们启动下一个索引.
We got a lot of new content, so we flushed the database, and had to reindex the content (about 168,000 elements). I created a script to index the contents by slices of 500 – when the script finishes, we launch the next indexing.
它在我的本地测试环境中运行良好,但在生产环境中出现 500 错误:
It works perfectly on my local test environment, but on production I get this 500 error:
[Thu Dec 02 ...] [error] [client IP] Premature end of script headers: index.php
在我的 php.log 中绝对没有任何内容,只有返回它的 apache error_log.我曾在网站的其他页面上看到它发生过一两次,但它是在编制索引期间发生的.
There is absolutely nothing in my php.log, just the apache error_log that returns it. I've seen it happen on other pages of the website once or twice, but it was during this indexing.
有什么想法吗?
推荐答案
此错误通常(有时)由 FcgidIOTimeout
指令(旧名称:IPCCommTimeout
).
This error is usually (sometimes) caused by the FastCGI setup of the FcgidIOTimeout
directive (old name: IPCCommTimeout
).
即 IO 超时的秒数,默认为 40 秒.超时意味着
That is the number of seconds for IO timeout, default is 40 seconds. Timeout means that
FastCGI 应用程序必须在这段时间内开始生成响应.根据需要增加此指令以处理需要相对较长时间响应的应用程序."
您可以尝试将其放入 vhost.conf 来解决:
You can try to solve it putting this into your vhost.conf:
<IfModule mod_fcgid.c>
# 5 minutes for IO timeout, default is 40 seconds
FcgidIOTimeout 300
</IfModule>
您可以根据需要增加它,然后在重新索引过程完成后恢复原始值.
You can increase it as you need and then restore the original value once the reindexing process is complete.
这篇关于500 服务器错误:脚本头过早结束:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!