OSError:[Errno 13]运行CGIHTTPServer时

时间:2017-02-25 23:48:11

标签: python ubuntu cgi

我在Ubuntu服务器上,当我运行python -m CGIHTTPServer 80时 它工作正常。但后来我转到它显示的网站:

172.16.1.19 - - [25/Feb/2017 17:23:52] "GET /cgi-bin/weather.py HTTP/1.1" 200 -
Traceback (most recent call last):
  File "/usr/lib/python2.7/CGIHTTPServer.py", line 248, in run_cgi
    os.execve(scriptfile, args, env)
OSError: [Errno 13] Permission denied

我使用iframe连接到CGI脚本

1 个答案:

答案 0 :(得分:0)

/cgi-bin/weather.py应该是可执行的。

确保您为该文件提供了适当的权限。例如:

chmod u+x /cgi-bin/weather.py
相关问题