2013-03-25 55 views
-1

我已經安裝Foswiki但我的問題,當我的應用程序嘗試加載圖像。這些圖像不加載...Perl CGI應用程序使用的圖像500錯誤

我已經得到了解決,但我不知道,如果是正確的......

這是我的CGI目錄

# 
# "C:/Archivos de programa/Apache Software Foundation/Apache2.2/cgi-bin" should be changed to whatever your ScriptAliased 
# CGI directory exists, if you have that configured. 
# 
<Directory "C:/Archivos de programa/Apache Software Foundation/Apache2.2/cgi-bin"> 
    AllowOverride All 
    Options +ExecCGI 
    AddHandler cgi-script .cgi .pl 
    AddHandler default-handler .jpg .png .gif .js .txt .bat .css 
    Order allow,deny 
    Allow from all 
</Directory> 

我的配置必須逐一添加擴展名:(...

+1

這不是一個Perl問題或編程問題。但答案是:你不應該在cgi-bin目錄下放置圖片或CSS(或任何類型的文件);只有可執行程序。 – hobbs 2013-03-26 00:29:12

+0

「不加載」 - 發生了什麼?請求到達服務器嗎?回覆中返回的是什麼狀態或內容? – ysth 2013-03-26 01:01:50

+0

我收到錯誤HTTP 500 – 2013-03-26 03:10:28

回答

1

走出這裏的一點肢體,但我猜測,除了包含在你的問題中的配置,這個目錄也是目標的ScriptAlias指令(可能爲/cgi-bin,po可以在默認的Apache配置中,而不是在你明確完成的事情中)。 ScriptAlias表示目錄中的每個文件都是CGI腳本;見the directive documentation。這就是爲什麼你必須用AddHandler覆蓋該行爲。

如果要控制使用文件擴展名爲.cgiAddHandler作爲CGI腳本執行哪些文件,請不要使用ScriptAlias。如果沒有ScriptAlias,默認情況下會將文件作爲資源提供,除非您明確聲明將其作爲CGI腳本執行。