我的windows-764位计算机上有Abyssweb服务器。我按照this official link中的说明向服务器添加python支持,因为我没有下载文档中考虑的活动Python,我只是在我的机器上使用了以前安装的Python3.3。在
我写了一个非常简单的python脚本:
print("Hello")
然后我在服务器的htdocs中将其保存为test.py
,然后我试图访问http://localhost:9090/test.py
,但是服务器返回错误500内部服务器错误记录此错误的日志行是:
cgi.log:
[21/Dec/2014:01:33:54 +0200] CGI: [C:\Python33\python.exe test.py ] URI: /test.py Bad CGI header line [Hello]
access.log:
127.0.0.1 - - [21/Dec/2014:01:33:54 +0200] "GET /test.py HTTP/1.1" 500 412 "" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"
那么我如何修复CGI标题行呢?在
我发现了如何修复CGI头,多亏了Himal,这个想法是先打印出内容类型,然后是一个空行,然后脚本可以正常工作:
相关问题 更多 >
编程相关推荐