利用Python编写CGI,Windows配置好Apache, 但是浏览器下:http://localhost/cgi-bin/hello.py, 就出行500错误,在error log内可以看到:是(OS5)拒绝访问错误。 已经试过把文件修改为完全控制,但还是错误依旧,请兄弟姐妹们帮忙指点。
#!C:/python27
# -*- coding: UTF-8 -*-
print "Content-type:text/html"
print # 空行,告诉服务器结束头部
print '<html>'
print '<head>'
print '<meta charset="utf-8">'
print '<title>Hello World - 我的第一个 CGI 程序!</title>'
print '</head>'
print '<body>'
print '<h2>Hello World! 我是来自菜鸟教程的第一CGI程序</h2>'
print '</body>'
print '</html>'
[Sun Apr 15 16:23:23.705800 2018] [cgi:error] [pid 3480:tid 864] (OS 5)拒绝访问。 : [client ::1:49810] couldn't create child process: 720005: hello.py
[Sun Apr 15 16:23:23.705800 2018] [cgi:error] [pid 3480:tid 864] (OS 5)拒绝访问。 : [client ::1:49810] AH01223: couldn't spawn child process: E:/Apache24/cgi-bin/hello.py
#!C:/python27
# -*- coding: UTF-8 -*-
print "Content-type:text/html"
print # 空行,告诉服务器结束头部
print '<html>'
print '<head>'
print '<meta charset="utf-8">'
print '<title>Hello World - 我的第一个 CGI 程序!</title>'
print '</head>'
print '<body>'
print '<h2>Hello World! 我是来自菜鸟教程的第一CGI程序</h2>'
print '</body>'
print '</html>'
[Sun Apr 15 16:23:23.705800 2018] [cgi:error] [pid 3480:tid 864] (OS 5)拒绝访问。 : [client ::1:49810] couldn't create child process: 720005: hello.py
[Sun Apr 15 16:23:23.705800 2018] [cgi:error] [pid 3480:tid 864] (OS 5)拒绝访问。 : [client ::1:49810] AH01223: couldn't spawn child process: E:/Apache24/cgi-bin/hello.py