Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
416 views
in Technique[技术] by (71.8m points)

php - 500 Server error: Premature end of script headers:

I have a website in php that works with a solr indexation server, based on CodeIgniter.

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.

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

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.

Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This error is usually (sometimes) caused by the FastCGI setup of the FcgidIOTimeout directive (old name: IPCCommTimeout).

That is the number of seconds for IO timeout, default is 40 seconds. Timeout means that

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...