1

我在 Windows XP 上使用 Apache 2.4.4。在尝试运行 CGI 脚本时,浏览器给出“500 Internal Server Error”,我在浏览各种论坛后尝试解决,但到目前为止没有运气我的 httpd.conf 文件如下:

<IfModule alias_module>
ScriptAlias /cgi-bin/ "D:/config/apache/cgi-bin/"

</IfModule>

<IfModule cgid_module>
#Scriptsock cgisock
</IfModule>

<Directory "D:/config/apache/cgi-bin/">
AllowOverride All
Options Includes ExecCGI
Order allow,deny
Allow from all
Require all granted
</Directory>

我还查看了错误日志,这就是问题所在:

[win32:error] [pid 3824:tid 1216] [client 192.168.1.4:1728] AH02102:      D:/config/apache/cgi-bin/printenv.pl is not executable; ensure interpreted scripts have "#!" or "'!" first line
[cgi:error] [pid 3824:tid 1216] (9)Bad file descriptor: [client 192.168.1.4:1728] AH01222: don't know how to spawn child process: D:/config/apache/cgi-bin/printenv.pl

请,非常感谢任何帮助。提前致谢

4

1 回答 1

0

我猜你的后端 cgi 消费者程序是你的 printenv.pl 的 perl。

并且错误很明显,apache 不知道如何处理这个 printenv.pl 文件。

您需要通过修改 apache 配置文件告诉 apache 如何解释它。

结帐 mine.types

在下面结帐。可能会有帮助。

是否可以在 Windows 下的 apache 中将批处理文件作为 cgi 运行?

于 2015-03-24T09:47:04.107 回答