【发布时间】:2016-02-11 11:30:55
【问题描述】:
这是 Python 脚本本身 (test.py):
#!/Users/misha/AppData/Local/Programs/Python/Python35-32
print("Content-Type: text/html\n")
print("\n\n")
print("<h1>Test</h1>")
我在 Apache 的配置文件 httpd.conf 中有这个:
<Directory "c:/Apache24/htdocs">
...
...
Options Indexes FollowSymLinks ExecCGI
...
...
</Directory>
AddHandler cgi-script .cgi .py
我重新启动 Apache——其他一切正常,但是当我尝试在浏览器中指向我的 Python 测试文件时,服务器向我抛出 Internal Server Error。
这是我的 Apache 最新的日志文件条目(为了便于阅读,我对它们进行了一些编辑):
(localhost-error.log)
[Thu Feb 11 14:24:39.357362 2016] [cgi:error] [pid 16872:tid 1028]
(OS 5)Access is denied. : [client 127.0.0.1:54957] AH01223:
couldn't spawn child process: C:/Apache24/htdocs/test.py
(localhost-access.log)
127.0.0.1 - - [11/Feb/2016:14:24:39 -0800] "GET /test.py HTTP/1.1"
500 528
我什至不知道现在该怎么办。
【问题讨论】: