Soycow: "Premature end of script headers"

"Premature end of script headers":

If you see the error: "Premature end of script headers: <cgi_filename>" in your Apache webserver error log, and you can't figure out why, you should try these steps:

  1. chmod 755 <cgi_filename>
  2. chmod 755 <directory_that_contains_cgi_filename>

If that fixes your problem, then your webserver provider is probably using suexec. The 'suexec' feature provides Apache users the ability to run CGI programs under user IDs different from the user ID of the calling web-server. When that feature of Apache is enabled, special restrictions are applied to CGI programs:

  1. The CGI directory must only be writeable by the user ID that is executing the CGI program.
  2. The CGI program must only be writeable by the user ID that is executing the CGI program.

More Info:

Comments

Posted by Deane on October 24, 2003 07:20 AM

Thanks for this. I suspected this was the problem, but I had tried doing the CHMOD via WS_FTP When that didn't work, I discounted it as a theory.

After seeing this, I decided to give it another go. I SSHed in and did a CHMOD from the command line, which worked.

Add a comment