[Pythonmac-SIG] newbie

Bob Ippolito bob at redivi.com
Thu Mar 11 13:21:18 EST 2004


The script is not your problem at this point.  Check to make sure that 
your apache configuration is correct, and the script is executable by 
the user that runs apache.

-bob

On Mar 11, 2004, at 7:07 PM, salamander wrote:

> like this?
>
> #!/usr/bin/python
>
> print "Content-type: text/html"
> print
>
> for x in range(1,6):
>   print x, x*x
>
> still bombs :(
>
> [Thu Mar 11 13:06:19 2004] [error] (2)No such file or directory: exec 
> of /www/test/pyvqs/squares.py failed
> [Thu Mar 11 13:06:19 2004] [error] [client 127.0.0.1] Premature end of 
> script headers: /www/test/pyvqs/squares.py
>
>
> On Mar 11, 2004, at 12:39 PM, Bob Ippolito wrote:
>
>>
>> On Mar 11, 2004, at 6:29 PM, salamander wrote:
>>
>>> trying to execute the "squares.py" script from VQS's Python book, as 
>>> a CGI:
>> ---
>>> but I get an Internal Server Error 500 in apache, and the error_log 
>>> shows:
>>>
>>> [Thu Mar 11 12:10:47 2004] [error] (2)No such file or directory: 
>>> exec of /www/test/pyvqs/squares.py failed
>>> [Thu Mar 11 12:10:47 2004] [error] [client 127.0.0.1] Premature end 
>>> of script headers: /www/test/pyvqs/squares.py
>>
>> It's broken because your script is not a CGI.  All CGIs, regardless 
>> of language, must output valid HTTP headers.  Add this to the top of 
>> your script:
>>
>> print "Content-type: text/html"
>> print
>>
>> -bob
>>
>>
>>
>
>
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig




More information about the Pythonmac-SIG mailing list