"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:
- chmod 755 <cgi_filename>
- 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:
- The CGI directory must only be writeable by the user ID that is executing the CGI program.
- The CGI program must only be writeable by the user ID that is executing the CGI program.
More Info:
Posted in
The Web
on Monday, February 17, 2003 at 07:22 PM
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.