我遇到了一个问题,我最近搬到了一个vps.我正在尝试运行python cgi脚本,但我得到一个apache脚本标头的过早结束错误.
(我chmod + x脚本文件)
该脚本非常简单:
#!/usr/bin/env python
import cgi, cgitb
cgitb.enable()
print "Content-type: text/html"
print "<html><body>hello scritp</body></html>"
Run Code Online (Sandbox Code Playgroud)
现在如果我将脚本命名为test**.py**它在服务器上运行良好.但是,如果我以正确的方式执行,请将其称为测试**.cgi**我收到内部服务器错误.
我从终端运行脚本
./test.cgi
Run Code Online (Sandbox Code Playgroud)
我没有错
Content-type: text/html
<html><body>hello scritp</body></html>
Run Code Online (Sandbox Code Playgroud)
有没有人遇到过这个问题?并为它的解决方案?:)干杯
| 归档时间: |
|
| 查看次数: |
8948 次 |
| 最近记录: |