500尝试运行python CGI脚本时内部错误wamp服务器

时间:2015-07-09 09:08:48

标签: python-3.x cgi wamp

我试图运行一个CGI python文件,我是html和服务器端编程的新手。我想在我的网络服务器(Wamp)上使用python脚本,所以我搜索并发现我可以使用Apache。我将代码放在.py文件中并将其放在cgi-bin文件夹中。当我运行它时出现错误,请注意我从python网站上偷了测试代码来测试它。

#!/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!")

这是我得到的错误:

[Thu Jul 09 14:11:58.841220 2015] [cgi:error] [pid 9940:tid 968] [client ::1:54621] script not found or unable to stat: C:/wamp/bin/apache/apache2.4.9/cgi-bin/CgiTest.py
[Thu Jul 09 14:26:59.338627 2015] [cgi:error] [pid 5500:tid 968] (OS 2)The system cannot find the file specified.  : [client ::1:54733] couldn't create child process: 720002: CgiTest.py
[Thu Jul 09 14:26:59.338627 2015] [cgi:error] [pid 5500:tid 968] (OS 2)The system cannot find the file specified.  : [client ::1:54733] AH01223: couldn't spawn child process: C:/wamp/bin/apache/apache2.4.9/cgi-bin/CgiTest.py

我确定名字是正确的。我收到500内部错误。我还确保在wamp服务器托盘图标中检查了cgi-modules。

0 个答案:

没有答案