ASU Web Community

CGI Errors, premature end of script headers

Tuesday, September 9th, 2008 - 2:59 pm
  • crschmi1

This is relevant to UTO Web Hosting users trying to run custom scripts. I just spent the last few hours battling a "premature end of script headers" in my CGI-Scripts, so I thought I would post the solution here in case anyone else is having problems. The problem started when I created a new directory from which to run script as opposed to the standard cgi-bin dir.

This error is generally cause when incomplete headers are return to apache, i.e. missing "Content-Type". In my cause the error was cause by a permissions problem.
The permissions on the new directory were, "drwxrwxr-x", ample permissions for apache to run the script.
Changing the permissions to "drwxr-xr-x", fixed the problem. Perhaps the error is designed to prevent security holes?

- Charlie.