我尝试使用这个作为python3中的服务器来运行cgi脚本:
from http.server import HTTPServer, CGIHTTPRequestHandler
port = 8080
httpd = HTTPServer(('', port), CGIHTTPRequestHandler)
print("Starting simple_httpd on port: " + str(httpd.server_port))
httpd.serve_forever()但我得到了以下错误:
Traceback (most recent call last):
File "/usr/lib/python3.2/http/server.py", line 1110, in run_cgi
os.execve(scriptfile, args, env)
OSError: [Errno 2] No such file or directory
localhost - - [21/Nov/2012 10:28:26] CGI script exit status 0x7f00请帮帮忙。
发布于 2013-02-07 06:19:18
希望这些帮助: 1.检查你要执行的脚本是否可执行?如果不是-rwx,则无法执行2.检查脚本的第一行,即#!.....如果此行没有正确指向python的文件夹,仍无法执行
https://stackoverflow.com/questions/13490311
复制相似问题