BugZilla:将 PerlConfigRequire 添加到 apache2 conf 会在重新启动服务时产生错误

BugZilla:将 PerlConfigRequire 添加到 apache2 conf 会在重新启动服务时产生错误

我一直在关注 BugZilla安装文档并使用 mod_perl 和 apache2。一切都进行得相当顺利,bugzilla 页面似乎被正确呈现和提供,但现在重新启动 apache 时我收到一些错误消息,并且每次加载页面时虚拟主机的错误日志中都会出现大量错误。

在我添加了这两行之后,这种情况开始发生,文档说要在任何其他 mod_perl 指令之前添加,所以我将它放在 httpd.conf 的顶部附近。

PerlSwitches -w -T
PerlConfigRequire /var/www/bugzilla/mod_perl.pl

现在,当重新启动 apache2 时,我得到了这个。

bugzilla01 ~: service apache2 restart
 * Restarting web server apache2
    Binary file (standard input) matches
 ... waiting Return::Value is deprecated at /var/www/bugzilla/lib/Return/Value.pm line 13
    require Return/Value.pm called at /var/www/bugzilla/lib/Email/Send.pm line 11
    Email::Send::BEGIN() called at /var/www/bugzilla/lib/Return/Value.pm line 0
    eval {...} called at /var/www/bugzilla/lib/Return/Value.pm line 0
    require Email/Send.pm called at /var/www/bugzilla/Bugzilla/Mailer.pm line 51
    Bugzilla::Mailer::BEGIN() called at /var/www/bugzilla/lib/Return/Value.pm line 0
    eval {...} called at /var/www/bugzilla/lib/Return/Value.pm line 0
    require Bugzilla/Mailer.pm called at /var/www/bugzilla/Bugzilla/Auth.pm line 35
    Bugzilla::Auth::BEGIN() called at /var/www/bugzilla/lib/Return/Value.pm line 0
    eval {...} called at /var/www/bugzilla/lib/Return/Value.pm line 0
    require Bugzilla/Auth.pm called at /var/www/bugzilla/Bugzilla.pm line 40
    Bugzilla::BEGIN() called at /var/www/bugzilla/lib/Return/Value.pm line 0
    eval {...} called at /var/www/bugzilla/lib/Return/Value.pm line 0
    require Bugzilla.pm called at /var/www/bugzilla/mod_perl.pl line 44
    Bugzilla::ModPerl::BEGIN() called at /var/www/bugzilla/lib/Return/Value.pm line 0
    eval {...} called at /var/www/bugzilla/lib/Return/Value.pm line 0
    require /var/www/bugzilla/mod_perl.pl called at (eval 2) line 1
    eval 'require q/var/www/bugzilla/mod_perl.pl
;' called at /var/www/bugzilla/lib/Return/Value.pm line 0

主页加载过程中出现的大量错误

[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: Return::Value is deprecated at lib/Return/Value.pm line 13, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \trequire Return/Value.pm called at lib/Email/Send.pm line 11, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \tEmail::Send::BEGIN() called at lib/Return/Value.pm line 0, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \teval {...} called at lib/Return/Value.pm line 0, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \trequire Email/Send.pm called at Bugzilla/Mailer.pm line 51, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \tBugzilla::Mailer::BEGIN() called at lib/Return/Value.pm line 0, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \teval {...} called at lib/Return/Value.pm line 0, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \trequire Bugzilla/Mailer.pm called at Bugzilla/Auth.pm line 35, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \tBugzilla::Auth::BEGIN() called at lib/Return/Value.pm line 0, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \teval {...} called at lib/Return/Value.pm line 0, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \trequire Bugzilla/Auth.pm called at Bugzilla.pm line 40, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \tBugzilla::BEGIN() called at lib/Return/Value.pm line 0, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \teval {...} called at lib/Return/Value.pm line 0, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \trequire Bugzilla.pm called at /var/www/bugzilla/index.cgi line 34, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \tmain::BEGIN() called at lib/Return/Value.pm line 0, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:34 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:34 2013] Value.pm: \teval {...} called at lib/Return/Value.pm line 0, referer:  bugzilla.domain.net/
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: Return::Value is deprecated at lib/Return/Value.pm line 13
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \trequire Return/Value.pm called at lib/Email/Send.pm line 11
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \tEmail::Send::BEGIN() called at lib/Return/Value.pm line 0
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \teval {...} called at lib/Return/Value.pm line 0
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \trequire Email/Send.pm called at Bugzilla/Mailer.pm line 51
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \tBugzilla::Mailer::BEGIN() called at lib/Return/Value.pm line 0
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \teval {...} called at lib/Return/Value.pm line 0
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \trequire Bugzilla/Mailer.pm called at Bugzilla/Auth.pm line 35
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \tBugzilla::Auth::BEGIN() called at lib/Return/Value.pm line 0
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \teval {...} called at lib/Return/Value.pm line 0
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \trequire Bugzilla/Auth.pm called at Bugzilla.pm line 40
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \tBugzilla::BEGIN() called at lib/Return/Value.pm line 0
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \teval {...} called at lib/Return/Value.pm line 0
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \trequire Bugzilla.pm called at /var/www/bugzilla/search_plugin.cgi line 21
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \tmain::BEGIN() called at lib/Return/Value.pm line 0
[Fri Feb 15 13:09:35 2013] [error] [client 10.1.0.1] [Fri Feb 15 13:09:35 2013] Value.pm: \teval {...} called at lib/Return/Value.pm line 0

答案1

Perl 开关-w启用警告。当您编写新的 Perl 脚本时,这很有用,但当您运行您信任的旧代码时,这可能会适得其反。在这种情况下,它会发出有关弃用语法的警告。

尝试移除-w并查看是否能清理干净。

答案2

我还没有进行大量测试来确定这是否会破坏任何东西,但是在我的系统中,如果我编辑以下文件,错误/警告就会被删除:

/var/www/bugzilla/lib/Return/Value.pm

注释掉以下行:

#Carp::cluck "Return::Value is deprecated" unless $NO_CLUCK;

可能需要进行一些测试来检查它是否会破坏任何东西,但从外观上看,这条线并没有做太多。

相关内容