Reputation: 43
I'm a python developer, but when i'm putting my file inside a cgi-bin directory and running it through my browser its showing 500 internal server error.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# enable debugging
import cgitb
cgitb.enable()
print "Content-Type: text/plain;charset=utf-8"
print
print "Hello World!"
This is my test.py. Filelocation : http://mywebsite.com/cgi-bin/test.py
.htaccess file :
RewriteEngine on
Options +ExecCGI AddHandler cgi-script cgi py
Options +ExecCGI SetHandler cgi-script
Please give some suggestion!
Upvotes: 1
Views: 3545
Reputation: 28405
Assuming that the server set up is OK the most likely problem is forgetting to set the python file to executable after copy to the cgi-bin directory.
Upvotes: 2