in reply to CGI Header problem/question

I keep getting "premature end of headers" in my error.log

I highly doubt that this is all you get, looking in your error log file. It probably contains more information, that could help you spot the error. What I always do, is:

$ tail -f /path/to/error.log
and press enter a couple of times, so it's clear where new input starts. Then re-run the script. All the appropriate errors will be shown.

You provide too little information, for -at least- me to figure out what is wrong. Please paste the exact error that you get (there's got to be more than the premature end of headers) and the appropriate code that you use.

Update: Once again ... I type to slow, since the "right answer" seems to be given and confirmed already...

--
b10m

Replies are listed 'Best First'.
Re: Re: CGI Header problem/question
by Nkuvu (Priest) on Dec 20, 2003 at 17:53 UTC
    Although the answer was already given, I just wanted to mention that the error really isn't much more than what I stated. The full error from the error_log:
    [Sat Dec 20 10:29:44 2003] [error] (8)Exec format error: exec of /Libr +ary/WebServer/CGI-Executables/mail_it.cgi failed [Sat Dec 20 10:29:44 2003] [error] [client 192.168.1.1] Premature end +of script headers: /Library/WebServer/CGI-Executables/mail_i t.cgi

    Not a lot to go on. As far as the code used, that's in the link at the top of the post. :)

      The first line of the error_log that you didn't include in your original post is actually the useful one that would have given the clue as to what the problem was. The "premature end of script headers" just means that the error happened and the script aborted (or in your case never executed) before the headers could be sent. It pretty much always follows the real error message and is therefore not of any help in diagnosing a script error.