我有奇怪的問題,cgi perl腳本無法正常工作,只有cgi bash腳本正在工作?從瀏覽器
從命令行CGI的bash腳本和CGI Perl腳本正在,但只有CGI的bash腳本正在努力,而不是和CGI Perl。
從瀏覽器訪問cgi perl腳本後我得到500內部服務器錯誤。
and apache error log says
[Thu Oct 25 01:58:59 2012] [error] [client x.x.x.x] (13)Permission denied: exec of '/home/x/x/x/x/public_html/cgi-bin/test.cgi' failed
[Thu Oct 25 01:58:59 2012] [error] [client x.x.x.x] Premature end of script headers: test.cgi
我想從瀏覽器運行cgi perl腳本。
我該怎麼做。
[[email protected] ~]# which perl
/usr/bin/perl
[[email protected] cgi-bin]# perl test.cgi
Content-type: text/plain
testing...
test.cgi源
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "testing...\n";
感謝您的時間。
它是一個專用的服務器和Apache 2
確保Web服務器的用戶標識已讀取並執行對'test.cgi'路徑中所有內容的權限。 – Barmar
嘗試'蘇WWW-data'(或任何的apache用戶),*然後*運行腳本,看看它是否工作。 – January
su apache無法正常工作,所以我將httpd.conf中的用戶和組更改爲cgi文件的所有者,並且所有的工作都完美無缺。,非常感謝,現在我該如何爲用戶apache添加權限以訪問.cgi文件 – AMB