CGI problem

Ray Loyzaga ray at commsecure.com.au
Wed Jan 12 06:43:25 EST 2000


Sposhua wrote:
> 
> On Fri, 7 Jan 2000, sp00fD wrote:
> 
> > I'm creating a CGI program, and I keep getting an error from apache:
> >
> > "(8) Exec format error exec of /usr/local/apache/htdocs/...
> > Premature end of script headers: /usr/local/apache/htdocs/..
> >
> > I've put the print "Content-type: text/html\n" (with anywhere from 0 to
> > 8 newlines after it) in there.
> >
> > What am I doing wrong?
> 
> Either
> a) The script has errors
> or
> b) You have to add 'HTTP:/1.1 200 OK\n' at the begining of the header. Don't ask
> me why, but on my server I can't run anything without that.

I think the exec is failing .... is the path for the cgi file accessible
to "nobody", do you start with #!/path to python executable
The other gotcha with this sort of error is to do a system("/bin/date") or
similar and not flush stdout before to make sure the headers are not
buffered and come out after the output of date.



More information about the Python-list mailing list