cgi

Mohamed Najmeddine mnajmeddine at geo.census.gov
Tue Jan 30 15:31:42 EST 2001


Hello,
My cgi script is working now. I had to add the following line at the
beginning of the file:
#!c:\python20\python.exe
I'm not sure why given the fact that the registry setup should have executed
the cgi script.
Anyhow, that seems to do it.
Med.

-----Original Message-----
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of Mohamed Najmeddine
Sent: Monday, January 29, 2001 11:02 AM
To: python-list
Subject: RE: cgi




-----Original Message-----
From: Mohamed Najmeddine [mailto:mnajmeddine at geo.census.gov]
Sent: Monday, January 29, 2001 10:59 AM
To: Chris Gonnerman
Subject: RE: cgi


Hello,
I have run the script from the command line and it works.
I have add the -u option to the registry and restarted the PC but I still
get the same error message. I should mention that I'm running on windows
2000 PRO.
I configured the Personal WebServer (PWS) according to the instructions
given at http://starship.python.net/crew/aaron_watters/pws.html
The /cgi-bin in inetpub/wwwroot/ dir is setup as "execute".

Attached are the scripts and the ouput.
Thanks,
MED.

-----Original Message-----
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of Chris Gonnerman
Sent: Saturday, January 27, 2001 10:11 AM
To: python-list at python.org
Subject: Re: cgi


----- Original Message -----
From: "Mohamed Najmeddine" <mnajmeddine at geo.census.gov>
> I have configured the IIS to run a simple cgi script named hello.cgi and
put
> the script on the dir c:/inetpub/wwwroot/cgi-bin/. The script is as
follows:
>
> print "Content-Type: text/html\n\n"
> print "Hello Python"
>
> and I got the following error message:
>
> CGI Error
> The specified CGI application misbehaved by not returning a complete set
of
> HTTP headers. The headers it did return are:
>
> syntax error at c:\inetpub\wwwroot\cgi-bin\hello.cgi line 4, near "print"
> Execution of c:\inetpub\wwwroot\cgi-bin\hello.cgi aborted due to
compilation
> errors.

Try to run the script directly from Python like so:

    python hello.cgi

You have a syntax error in the script.  I can't see an error in the sample
you posted, but there must be one there.

Also, regarding the registry setup for Python, using the -u (unbuffered)
option is sometimes necessary:

    "C:\python\python.exe -u %s %s"



--
http://mail.python.org/mailman/listinfo/python-list


--
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list