[Tutor] CGI fails
Marcel Preda
marcel@punto.it
Wed, 20 Sep 2000 18:04:18 +0200 (CEST)
On Wed, 20 Sep 2000, D-Man wrote:
> Hi.
>
> I'm trying to use Python to do some CGI scripting on my webserver. I followed
> the directions in the FAQ to enable CGI on the server's conf files (Apache on
> Linux x86).
>
> I was trying the "Hello World" example (attached), but I get an "Internal
> Server Error". The error log file says:
>
> [Wed Sep 20 11:19:16 2000] [error] [client 129.21.137.39] Premature end of
> script headers: /home/dman/public_html/script.py.cgi
> [Wed Sep 20 11:19:16 2000] [error] [client 129.21.137.39] Premature end of
> script headers: /home/dman/public_html/script.py.cgi
The frist `output' in the python script (CGI)
must be:
print "\n"
or
print "Content-type: <yourType>\n"
<yourType> could be:
text/html
text/plain
...
[look in `mime.types' file]
PM