“cpanm PHP”失败 [英] "cpanm PHP" fails

查看:178
本文介绍了“cpanm PHP”失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了安装模块,我应该更改什么? php是5.3.3, yum安装php-devel

What should I change in order to install the module? php is 5.3.3 withyum install php-devel in place.

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.
(


推荐答案

PHP 是很脆弱的,它可能不会用你的系统开箱即用 php 安装,并且可能对 perl 的64位或多线程版本有麻烦。

PHP is kind of fragile. It probably won't work out of the box with your system php installation, and may have trouble with 64-bit or multi-threaded versions of perl.

我只有在Linux上工作,我试图使用的最新版本是5.3.8(2013年回来),虽然我记得事情从5.2.x顺利地到5.3。 8。

I have only ever gotten it to work on Linux. The latest version I have tried to use is 5.3.8 (back in 2013), though I remember things going smoothly from 5.2.x to 5.3.8.

我始终从源码构建 php ,配置如下:

I always build php from source, with this configuration:

./configure --enable-embed --with-zlib --with-openssl --with-mysql \
        --with-libdir=lib/i386-linux-gnu

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

--enable-embed is absolutely required, as the pod mentions, to build a PHP interpreter with the SAPI extension, and which then allows perl to manipulate the PHP interpreter through XS code. The other extensions were for other requirements of my project; they may be optional, but I haven't experimented with building the PHP interpreter or the PHP module with any other configuration. The pod also says to never use the --with-apxs argument, which I was never tempted to do anyway.

PHP 模块的构建过程将寻找并需要一个名为 php-config 的程序。您可能需要破解 $ PATH (如果只在构建过程中),以便 PHP 模块运行正确 php-config 。之后,模块将知道在哪里寻找剩下的php安装。

The build process of the PHP module will look for and require a program called php-config. You may need to hack your $PATH, if only during the build process, so that the PHP module runs the correct php-config. After that the module will know where to look for the rest of your php installation.

我很高兴与这个模块工作一段时间(写一个Catalyst,然后一个Mojolicious WordPress的包装器),但它已经陷入失修和disreteable。分享你学习的任何东西,尝试建立它,我们会把它放在文档中,使这个模块更容易使用。

I had fun working with this module for a while (writing a Catalyst and then a Mojolicious wrapper around WordPress), but it has fallen into disrepair and disrepute. Share whatever you learn trying to build it and we'll put it in the docs, making this module that much easier to use.

这篇关于“cpanm PHP”失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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