安装mod_perl2时出错 [英] Error when installing mod_perl2

查看:265
本文介绍了安装mod_perl2时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下配置安装mod_perl2:
操作系统: CentOS版本5.5(最终版)
Uname-结果: x86_64 x86_64 x86_64 GNU/Linux
Perl版本:为x86_64-linux-thread-multi
apache版本构建的v5.8.8: Apache/2.2.3
我有从 Cpan网站下载了mod_perl2/a>
当我尝试运行"perl Makefile.PL MP_APXS =/usr/local/httpd/bin/apxs"时,它显示以下输出:

I am trying to install mod_perl2 with below configuration:
OS: CentOS release 5.5 (Final)
Uname -a result: x86_64 x86_64 x86_64 GNU/Linux
Perl version: v5.8.8 built for x86_64-linux-thread-multi
apache version: Apache/2.2.3
I have downloaded mod_perl2 from Cpan site
when I try to run the "perl Makefile.PL MP_APXS=/usr/local/httpd/bin/apxs" it gives below output:

在./Makefile.PL行137中重新定义了子例程set_version. [info]生成脚本t/TEST
[info]生成脚本./t/cgi-bin/cookies.pl
[info]生成脚本./t/cgi-bin/next_available_port.pl
正在检查Cwd ...确定
正在检查文件:: Spec ...确定
[info]生成脚本t/TEST
生成Unix风格的Makefile
为mod_perl2编写Makefile
[警告] mod_perl dso库将构建为mod_perl.so
[警告]您需要在httpd.conf中添加以下内容:
[警告]
[警告] LoadModule perl_module modules/mod_perl.so
[警告]
[警告]取决于您的构建,mod_perl可能不存在
[警告] modules/目录.

[警告]检查结果
[警告]
[警告] $/usr/local/httpd/bin/apxs -q LIBEXECDIR
[警告] [警告]并相应地调整LoadModule指令.

Subroutine set_version redefined at ./Makefile.PL line 137.
[ info] generating script t/TEST
[ info] generating script ./t/cgi-bin/cookies.pl
[ info] generating script ./t/cgi-bin/next_available_port.pl
Checking for Cwd...ok
Checking for File::Spec...ok
[ info] generating script t/TEST
Generating a Unix-style Makefile
Writing Makefile for mod_perl2
[warning] mod_perl dso library will be built as mod_perl.so
[warning] You'll need to add the following to httpd.conf:
[warning]
[warning] LoadModule perl_module modules/mod_perl.so
[warning]
[warning] depending on your build, mod_perl might not live in
[warning] the modules/ directory.

[warning] Check the results of
[warning]
[warning] $ /usr/local/httpd/bin/apxs -q LIBEXECDIR
[warning] [warning] and adjust the LoadModule directive accordingly.

在"make"命令下运行后,发生错误:
modperl_env.c:在函数"modperl_env_magic_local_all"中:
modperl_env.c:544:错误:未声明"MGf_LOCAL"(此功能首次使用)
modperl_env.c:544:错误:(每个未声明的标识符仅报告一次
modperl_env.c:544:错误:出现在每个函数中.)
modperl_env.c:在顶层:
modperl_env.c:642:警告:结构初始化程序中的多余元素
modperl_env.c:642:警告:("MP_vtbl_env"初始化附近)
modperl_env.c:在函数"modperl_env_init"中:
modperl_env.c:661:警告:传递"Perl_mg_find"的参数2会丢弃指针目标类型中的
限定符
modperl_env.c:673:警告:函数"mg_free_type"的隐式声明
modperl_env.c:678:错误:未声明"MGf_LOCAL"(此功能首次使用)
modperl_env.c:在"modperl_env_unload"函数中:
modperl_env.c:690:警告:传递"Perl_mg_find"的参数2会丢弃指针目标类型中的
限定符
make
1 : * [modperl_env.lo]错误1
make 1 :离开目录`/opt/mod_perl-2.0.10/src/modules/perl'
make:*
[modperl_lib]错误2

After "make" command runs below error occurs:
modperl_env.c: In function ‘modperl_env_magic_local_all’:
modperl_env.c:544: error: ‘MGf_LOCAL’ undeclared (first use in this function)
modperl_env.c:544: error: (Each undeclared identifier is reported only once
modperl_env.c:544: error: for each function it appears in.)
modperl_env.c: At top level:
modperl_env.c:642: warning: excess elements in struct initializer
modperl_env.c:642: warning: (near initialization for ‘MP_vtbl_env’)
modperl_env.c: In function ‘modperl_env_init’:
modperl_env.c:661: warning: passing argument 2 of ‘Perl_mg_find’ discards
qualifiers from pointer target type
modperl_env.c:673: warning: implicit declaration of function ‘mg_free_type’
modperl_env.c:678: error: ‘MGf_LOCAL’ undeclared (first use in this function)
modperl_env.c: In function ‘modperl_env_unload’:
modperl_env.c:690: warning: passing argument 2 of ‘Perl_mg_find’ discards
qualifiers from pointer target type
make1: * [modperl_env.lo] Error 1
make1: Leaving directory `/opt/mod_perl-2.0.10/src/modules/perl'
make: *
[modperl_lib] Error 2

希望提供任何帮助,如果我问错了,请进一步指导(请不要投反对票:))

any help is appriciated, if i have asked somthing wrong please guide further (no down votes please :) )

推荐答案

此常量是perl 5.9.3中引入的,mod_perl从2.0.10开始使用.

This constant as been introduced in perl 5.9.3, and mod_perl use it from 2.0.10.

http://search. cpan.org/~vpit/Variable-Magic-0.62/lib/Variable/Magic.pm#MGf_LOCAL https://perl5.git.perl.org/perl.git/commit/a5063e7cd8fef802efd25ffe9df2c3748f4254f6 https://github.com/apache/mod_perl/commit/82827132efd3c2e25cc413c85af61bb63375da6e https://perldoc.perl.org/perlguts.html

http://search.cpan.org/~vpit/Variable-Magic-0.62/lib/Variable/Magic.pm#MGf_LOCAL https://perl5.git.perl.org/perl.git/commit/a5063e7cd8fef802efd25ffe9df2c3748f4254f6 https://github.com/apache/mod_perl/commit/82827132efd3c2e25cc413c85af61bb63375da6e https://perldoc.perl.org/perlguts.html

要克服这个问题,您必须修改mod_perl以使用perl版本的该常量:

to overcome this you must modify mod_perl to use this constant conditionaly of the perl version:

diff -ruw mod_perl-2.0.11/src/modules/perl/modperl_env.c mod_perl-2.0.11.patched/src/modules/perl/modperl_env.c
--- mod_perl-2.0.11/src/modules/perl/modperl_env.c      2017-12-06 11:08:55.000000000 -0500
+++ mod_perl-2.0.11.patched/src/modules/perl/modperl_env.c      2018-03-27 15:02:14.174790000 -0400
@@ -541,7 +541,9 @@
     nmg = sv_magicext(nsv, mg->mg_obj, mg->mg_type, &MP_vtbl_env, (char*)NULL, 0);
     nmg->mg_ptr = mg->mg_ptr;
     nmg->mg_flags |= MGf_COPY;
+#if MP_PERL_VERSION_AT_LEAST(5, 9, 3)
     nmg->mg_flags |= MGf_LOCAL;
+#endif

     return 1;
 }
@@ -679,7 +681,9 @@
     /* Add our version instead */
     mg = sv_magicext((SV*)ENVHV, (SV*)NULL, PERL_MAGIC_env, &MP_vtbl_env, (char*)NULL, 0);
     mg->mg_flags |= MGf_COPY;
+#if MP_PERL_VERSION_AT_LEAST(5, 9, 3)
     mg->mg_flags |= MGf_LOCAL;
+#endif
 }

 void modperl_env_unload(pTHX)

这篇关于安装mod_perl2时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆