php - 500 服务器错误 : Premature end of script headers:

标签 php apache codeigniter

我有一个 php 网站,可与基于 CodeIgniter 的 solr 索引服务器一起使用。

我们获得了很多新内容,因此我们刷新了数据库,并且不得不重新索引内容(大约 168,000 个元素)。我创建了一个脚本来按 500 个切片索引内容 - 当脚本完成时,我们启动下一个索引。

它在我的本地测试环境中完美运行,但在生产中我得到这个 500 错误:

[Thu Dec 02 ...] [error] [client IP] Premature end of script headers: index.php

我的 php.log 中绝对没有任何内容,只有返回它的 apache error_log。我曾经在网站的其他页面上看到过这种情况发生过一两次,但它是在索引编制期间。

有什么想法吗?

最佳答案

此错误通常(有时)是由 FcgidIOTimeout directive 的 FastCGI 设置引起的(旧名称:IPCCommTimeout)。

即IO超时秒数,默认为40秒。超时意味着

"The FastCGI application must begin generating the response within this period of time. Increase this directive as necessary to handle applications which take a relatively long period of time to respond."

您可以尝试将其放入您的 vhost.conf 中解决:

<IfModule mod_fcgid.c>
  # 5 minutes for IO timeout, default is 40 seconds
  FcgidIOTimeout 300
</IfModule>

您可以根据需要增加它,然后在重建索引过程完成后恢复原始值。

关于php - 500 服务器错误 : Premature end of script headers:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4336757/

相关文章:

c# - 如何使用 API 传输密码

php - ajax通过传递参数加载外部文件

java - 如何使用apache POI在文档中换行

apache - htaccess帮助,需要强制www,https并删除index.php

php - CodeIgniter:我在提交注册表时出现此数据库错误 1048。

php - 所有设备的 FFmpeg 命令配置文件

PHP/MySQL : Compare cells in one column and overwrite matching substrings in another column or table

java - Lucene OR 搜索使用 boolean 查询

php - 公共(public)函数与 CodeIgniter 中的函数

php - 在表单的一列中插入多个值