gitweb.cgi:“腳本標頭提前結束:gitweb.cgi”

gitweb.cgi:“腳本標頭提前結束:gitweb.cgi”

我在 Arch 上運行 LAMP,現在希望 gitweb 在 apache 上運行。請按照如下所示的說明進行操作https://wiki.archlinux.org/index.php/Gitweb但在 gitweb 目錄(此處localhost/~myuser/gitweb)上我得到:

Server error!

The server encountered an internal error and was unable to complete your request.

Error message: 
Premature end of script headers: gitweb.cgi

If you think this is a server error, please contact the webmaster.

Error 500

localhost
Fri Jun 8 15:14:11 2012
Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.1c DAV/2 PHP/5.4.3

答案1

我遇到了同樣的錯誤並透過安裝perl-cgi套件解決了它

$ sudo pacman -S perl-cgi

注意,我透過直接運行失敗的腳本來調試它,即,

$ cd /usr/share/gitweb/ 
$ ./gitweb.cgi
Can't locate CGI.pm in @INC (you may need to install the CGI module)(@INC contains: /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at ./gitweb.cgi line 13.
BEGIN failed--compilation aborted at ./gitweb.cgi line 13.

相關內容