作者c224456k (看看文章的說!)
看板Linux
標題[問題] linux 下cgi問題
時間Fri Feb 24 14:29:42 2012
出現這種問題
1.檢查資料及檔案權限
2.http conf 是否指向可用cgi資料夾
3.檢查cgi檔案是否轉成UNIX格式(我就是卡在這關)
-----------------------------------------------
安裝好 httpd
檔案放入 /var/www/html/.
網頁看起來沒問題
把cgi放入/var/www/cgi-bin/.
執行 127.0.0.1/cgi-bin/.
會出現 500
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
是perl 的問題嗎? 還是什麼 請高手解!
入徑: /var/www/cgi-bin/read.cgi
使用 perl /var/www/cgi-bin/read.cgi 出的來
links
http://127.0.0.1/cgi-bin/read.cgi 出現500
用IE開也是 500
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.120.1.136
※ 編輯: c224456k 來自: 59.120.1.136 (02/24 14:35)
→ catyun:找log出來看看就知道了 02/24 16:51
推 scribeTW:chmod +x ? 02/24 16:59
[Fri Feb 24 17:17:10 2012] [error] [client 192.168.1.116] (8)Exec format error: exec of '/var/www/cgi-bin/read.cgi' failed
[Fri Feb 24 17:17:10 2012] [error] [client 192.168.1.116] Premature end of script headers: read.cgi
※ 編輯: c224456k 來自: 59.120.1.136 (02/24 17:19)
→ c224456k:/var/log/httpd/error_log 出現這個 02/24 17:20
→ tjjh89017:會不會像是2F所說的權限問題? chmod 755 * 試試看 02/24 22:18
※ 編輯: c224456k 來自: 59.120.1.136 (03/01 10:05)