Web programming in Python.
steve at holdenweb.com
Mon Sep 29 15:39:19 CEST 2008
Kurda Yon wrote:
> 1. On my server (in my directory) I found "cgi-bin" subdirectory.
> 2. In the "cgi-bin" I have created a file "test.py".
> 3. In that file I put:
> #!/usr/bin/python2.4 python
OK, if /usr/bin/python2.4 really *is* a directory then you will need to
make that first line
(The phrase folowing the "#!" should be a reference to your Python
> print "Hello, World!"
Also, this isn't going to be adequate as an HTTP response, which a CGI
script is always supposed to provide. A minimal example would have a
single header followed by a blank like (which marks the end of the
headers) and your content, like this:
print """Content-Type: text/plain
> (I have checked, I have "/usr/bin/python2.4" directory.)
> 4. I give the following permissions to the "test.py":
> 5. The "cgi-bin" directory has the following permissions:
> 6. In the "cgi-bin" I have created the ".htaccess" file which
> Options +ExecCGI
> AddHandler cgi-script .py
> And it still does not work! If I try to see the page by my browser I
> Internal Server Error
> The server encountered an internal error or misconfiguration and was
> unable to complete your request.
If that doesn't get your script working then you should look at the
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
More information about the Python-list