簡體   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