[Tutor] CGI fails

Sean 'Shaleh' Perry shaleh@valinux.com
Wed, 20 Sep 2000 10:23:40 -0700


On Wed, Sep 20, 2000 at 06:04:18PM +0200, Marcel Preda wrote:
> On Wed, 20 Sep 2000, D-Man wrote:
> 
> > [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"

To be more clear, cgis MUST output:
Content-Type: <mimeType>\n
\n
(content type, then *two* newlines) which is your header.

Because of this not happening, you are getting a "premature end" message.  The
server is not seeing the cgi header and flagging and error.