繁体   English   中英

在Apache中运行CGI脚本

[英]Running CGI Scripts in Apache

我在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

拜托,我们非常感谢您的帮助。 提前致谢

我想您的后端cgi使用者程序是您的printenv.pl的perl。

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

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

签出mine.types

在下面查看此内容。 可能会有所帮助。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM