1
votes

im new with Python CGI Programming and i start with getting errors :(

so i start a simple 'hello world' script but i got 500 Internal Server Error

the index.py file:

#!/usr/bin/python
#!/Python27/python
import cgi
import cgitb; cgitb.enable()
print "Content-Type: text/html\n\n"

print "hello world"  

.htaccess file:

Options Indexes FollowSymLinks
Add ExecCGI
Options Indexes FollowSymLinks ExecCGI
AddHandler cgi-script .py .cgi
DirectoryIndex index.py

i tried with chmod but same problem :( help me please

1
You should look in the apache error logs.pvg
did you do sudo chmod 755 index.py?bigOther
@bigOTHER i did in the htaccess file before ' chmod -x 'script0r
@pvg im using windows (localhost)script0r
Apache logs in windows as well.pvg

1 Answers

0
votes

Options Indexes FollowSymLinks would override Options ExecCGI. To resolve this use Options +ExecCGI and also add SetHandler cgi-script