2010-01-04 64 views
0

我是CGI-Perl和會議的新手。運行以下代碼時遇到問題。如何在一系列Perl CGI腳本中創建和維護會話?

我已經四個文件 1. Session.html或Session.pm 2. name.pl 3. hobbies.pl 4. job.pl

的Session.pm是地方在/ var/www/html文件夾,其餘文件放在/ var/www/cgi-bin/session文件夾中。

我有有一個鏈接到Perl腳本這是給下面的錯誤

[Mon Jan 04 14:21:24 2010] [error] [client ::1] Options ExecCGI is off in this directory: /var/www/html/name.pl, referer: http://localhost/Session.html 
[Mon Jan 04 14:21:29 2010] [error] [client ::1] Options ExecCGI is off in this directory: /var/www/html/name.pl, referer: http://localhost/Session.html 
[Mon Jan 04 14:22:42 2010] [error] [client ::1] (13)Permission denied: exec of '/var/www/cgi-bin/session/name.pl' failed, referer: http://localhost/Session.pm 
[Mon Jan 04 14:22:42 2010] [error] [client ::1] Premature end of script headers: name.pl, referer: http://localhost/Session.pm 

請幫我在執行上面的例子中一個基本的HTML文件(Session.html)。請給我從開始就要遵循的步驟。

+1

而不會顯示在瀏覽器中的500服務器錯誤,您可以檢查錯誤日誌文件(位於,好,你的Apache的錯誤日誌存儲到),並張貼您的請求錯誤日誌條目。 它通常指出發生問題的位置。 – kender 2010-01-04 08:22:24

回答

4

...選項ExecCGI是關閉此目錄中:/var/www/html/name.pl,...

此錯誤指向試圖在/ var/WWW運行name.pl/html /而不是/ var/www/cgi-bin/session/

您發佈的Session.html是否正確,因爲它似乎不符合此錯誤?

...(13)權限被拒絕:的 '/var/www/cgi-bin/session/name.pl' 失敗,高管...

name.pl無法運行,因爲它沒有設置執行權限(在Linux/Unix上你需要chmod a+x name.pl)。


您可能需要顯示Session.pm的功能(它看起來不像您在這裏使用CPAN模塊Session)。

在一般說明中,我會考慮先簡化一下簡單的HTML & CGI腳本,然後讓它工作。然後開始查看會話等。

請查看Ovid's CGI Tutorial瞭解關於Perl/CGI主題的一些關於sage的建議。

/I3az/