【发布时间】:2013-01-16 00:43:42
【问题描述】:
大家好,我正在尝试关注 http://elvenware.com/charlie/development/web/Python/Xampp.html 来使用 xampp 设置 python。我正在运行 xammp usb lite 1.77
按照此处和Python & XAMPP on Windows: how to? 上的指示,
我已经创建了
#!F:/Python27/python
print "Content-type: text/html\n\n"
print "<html><head><title>Hello World from Python</title></head><body>Hello World from a Python CGI Script</body></html>
当我将它放在 cgi-bin 文件夹中并像 htp://localhost/cgi-bin/test.py 一样运行它后尝试运行它时,我得到:
Premature end of script headers: test.py
顺便说一句,包含的 htp://localhost/cgi-bin/cgi.cgi 脚本有效!!
知道我能做些什么来解决这个问题吗?
提前谢谢你,
比尔
【问题讨论】:
-
+1 到@sotapme。你应该把它写下来作为答案。请注意,如果您在命令行上运行相同的脚本,它将引发
SyntaxError: EOL while scanning string literal,甚至不会执行第一个print语句。这意味着没有标头被打印出来,这意味着您将从xampp收到此错误。