I am just getting started with python cgi programming. I started out rather ambitiously with a python script that ran but failed. I have since been whitling it down to barebones, and somewhere along the way it stopped executing altogether. I now get the following error when I try to run any python script.
[quote]"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request."[/quote]
My python file currently consists of (only):
import cgi, os
import cgitb; cgitb.enable()
#form = cgi.FieldStorage() # instantiate only once!
print “” # HTML is following
print # blank line, end of headers
print "CGI script output"
This is my first CGI script"
print “Hello, world!”
#for key in form.keys():
If I run it from the shell it runs fine, but gives the above error when I call it from a web browser, either directly or in a post statement on a web form.
I’ve also run dos2unix on it from the shell just because, but that didn’t help.