首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >"cpanm“失败

"cpanm“失败
EN

Stack Overflow用户
提问于 2015-08-25 17:18:16
回答 1查看 120关注 0票数 2

为了安装模块,我应该更改什么?php为5.3.3,yum install php-devel已到位。

代码语言:javascript
复制
PHP.c: In function ‘PHP_set_php_input’:
PHP.c:818: warning: passing argument 2 of ‘Perl_sv_2pv_flags’ from incompatible pointer type
/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/proto.h:3931: note: expected ‘STRLEN * const’ but argument is of type ‘int *’
cc -c  -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -Wall -O2   -DVERSION=\"0.15\" -DXS_VERSION=\"0.15\" -fPIC "-I/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE"   array.c
In file included from /usr/include/php/main/php.h:33,
                 from /usr/include/php/sapi/embed/php_embed.h:23,
                 from PHP.h:14,
                 from array.c:9:
/usr/include/php/main/php_config.h:2417:1: warning: "_GNU_SOURCE" redefined
In file included from /home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/perl.h:28,
                 from PHP.h:9,
                 from array.c:9:
/home/mpapec/.plenv/versions/5.20.0/lib/perl5/5.20.0/x86_64-linux/CORE/config.h:1825:1: warning: this is the location of the previous definition
rm -f blib/arch/auto/PHP/PHP.so
cc  -shared -O2 -L/usr/local/lib -fstack-protector PHP.o array.o  -o blib/arch/auto/PHP/PHP.so  \
                \

chmod 755 blib/arch/auto/PHP/PHP.so
"/home/mpapec/.plenv/versions/5.20.0/bin/perl5.20.0" -MExtUtils::Command::MM -e 'cp_nonempty' -- PHP.bs blib/arch/auto/PHP/PHP.bs 644
Manifying 1 pod document
Running Mkbootstrap for PHP ()
chmod 644 "PHP.bs"
PERL_DL_NONLAZY=1 "/home/mpapec/.plenv/versions/5.20.0/bin/perl5.20.0" "-Iblib/lib" "-Iblib/arch" test.pl
1..79
not ok 1 - use_ok PHP
#   Failed test 'use_ok PHP'
#   at test.pl line 11.
not ok 2 - require PHP;
#   Failed test 'require PHP;'
#   at test.pl line 18.
#     Tried to require 'PHP'.
#     Error:  Attempt to reload PHP.pm aborted.
# Compilation failed in require at (eval 6) line 2.
not ok 3 - eval
#   Failed test 'eval'
#   at test.pl line 49.
Module PHP failed to load at blib/lib/PHP.pm line 80.
Module PHP failed to load at blib/lib/PHP.pm line 80.
END failed--call queue aborted at test.pl line 50.
# Looks like you planned 79 tests but ran 3.
# Looks like you failed 3 tests of 3 run.
# Looks like your test exited with 22 just after 3.
make: *** [test_dynamic] Error 22
-> FAIL Installing PHP failed. See /home/mpapec/.cpanm/work/1440522239.12833/build.log for details. Retry with --force to force install it.
(
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-25 18:21:07

PHP有点脆弱。在您的系统php安装中,它可能无法开箱即用,而且perl的64位或多线程版本也可能会出现问题。

我只让它在Linux上工作过。我尝试使用的最新版本是5.3.8 (早在2013年),尽管我记得从5.2.x到5.3.8之间的事情进展顺利。

使用以下配置,我总是从源代码构建php

代码语言:javascript
复制
./configure --enable-embed --with-zlib --with-openssl --with-mysql \
        --with-libdir=lib/i386-linux-gnu

正如pod所提到的,--enable-embed绝对需要构建一个带有SAPI扩展的PHP解释器,然后允许perl通过XS代码操作PHP解释器。其他扩展用于我的项目的其他需求;它们可能是可选的,但我还没有尝试用任何其他配置构建PHP解释器或PHP模块。吊舱还说永远不要使用--with-apxs参数,我从来没有想过要这么做。

PHP模块的构建过程将查找并需要一个名为php-config的程序。如果只是在构建过程中,您可能需要黑入您的$PATH,以便PHP模块运行正确的php-config。在此之后,模块将知道在何处查找php安装的其余部分。

我用这个模块玩了一段时间(编写了一个催化剂,然后编写了一个关于WordPress的移动包装器),但是它已经陷入了失修和失名的境地。分享你学到的构建它的东西,我们会把它放到文档中,使这个模块更容易使用。

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32210214

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档