Premature end of script...

Drew Fisher drew at level3.net
Mon Aug 28 10:29:25 EDT 2000


Jacobus van der Merwe wrote:

> Hi,
>
> I downloaded Pyca (Certificate authority) and installed it.  I had
> several
> problems with modules that was not on the search path. (I'm very new to
> Python).
> While the modules were not correctly positioned, I got an error message
> of
> module not found (obviously), followed by the error message below.
>
> All modules are now on the search path, but I still receive the error
> message
> below.  That is the only entry made in the error_log when I try to run
> one of
> the scripts.
>
> Error message:
> "[Mon Aug 28 15:12:33 2000] [error] [client 192.6.2.8] Premature end of
> script he
> aders: /etc/apache/cgi-bin/pyca/ca-index.py"
>
> Any help will be greatly appreciated.
>
> Jacobus

Couple of things with CGI programs.

a)  Make sure to "run" the CGI program in a shell somewhere to make sure
there are no syntax errors.

b)  In your main function, pipe stderr to stdout so you can see the errors
of the CGI script in a web browser:

                sys.stderr = sys.stdout

c)  Make sure you print the HTML headers.  Without these, the web browser
doesn't know what kind of content is being
shown.  Do this right after the previous step.

                print 'Content-type: text/html\n\n'

Hope this helps

Drew




More information about the Python-list mailing list