Page 1 of 1

premature end of script headers error

Posted: Thu May 08, 2003 4:04 am
by mcshane
I've found a few references to this problem - looking at a .php page and getting an 'Internal Server Error' where in the apache error log all you get is 'premature end of script headers' error. However, I get this only some of the time - most of the time everything works fine, but looking through the logs every so often there will be a bunch of these errors. Then everything will work fine again for a while.

Okay, a few details. php 4.1.2, apache 1.3.26, linux 2.4.20 (SMP). full details from phpinfo at http://www.mcshane.org/phpexp/. Currently I've got php running by adding the following to my .htacces file

AddType application/x-httpd-php .php .phtml
Action application/x-httpd-php /cgi-bin/php.cgi

with /cgi-bin/php.cgi just being

#!/usr/lib/cgi-bin/php4

One possible solution suggested on this board was the doc_root setting- it is unset in my case. File permissions of the .php scripts being executable was another - none of mine are (all 644), but as I said it all works fine most of the time. Could this still be the cause of the problem?

Any other suggestions?

mcshane