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!
假设服务器设置正常,最可能的问题是在复制到cgi-bin目录后忘记将python文件设置为可执行文件。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.