我尝试过这三种不同的方式,但没有一种方法可行。第一个:
root@TheBad:/usr/local/src/# pecl install perl
Package "perl" Version "1.0.0" does not have REST xml available
install failed
第二种方法:下载tar文件并让pecl尝试安装:
root@TheBad:/usr/local/src/php-perl# wget 'http://pecl.php.net/get/perl-1.0.0.tgz'
root@TheBad:/usr/local/src/php-perl# pecl install perl-1.0.0.tgz
No release notes found
Parsing of package.xml from file "/build/buildd/php5-5.3.2/pear-build-download/package.xml" failed
install failed
第三种方法:解压缩tar文件,尝试手动安装:
root@TheBad:/usr/local/src/php-perl# tar xf perl-1.0.0.tgz
root@TheBad:/usr/local/src/php-perl# cd perl-1.0.0/
root@TheBad:/usr/local/src/php-perl/perl-1.0.0# phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
root@TheBad:/usr/local/src/php-perl/perl-1.0.0# ./configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
.......(configures successfully)
root@TheBad:/usr/local/src/php-perl/perl-1.0.0# make install
/bin/bash /usr/local/src/php-perl/perl-1.0.0/libtool --mode=compile cc -I. -I/usr/local/src/php-perl/perl-1.0.0 -DPHP_ATOM_INC -I/usr/local/src/php-perl/perl-1.0.0/include -I/usr/local/src/php-perl/perl-1.0.0/main -I/usr/local/src/php-perl/perl-1.0.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.10/CORE -c /usr/local/src/php-perl/perl-1.0.0/php_perl.c -o php_perl.lo
libtool: compile: cc -I. -I/usr/local/src/php-perl/perl-1.0.0 -DPHP_ATOM_INC -I/usr/local/src/php-perl/perl-1.0.0/include -I/usr/local/src/php-perl/perl-1.0.0/main -I/usr/local/src/php-perl/perl-1.0.0 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.10/CORE -c /usr/local/src/php-perl/perl-1.0.0/php_perl.c -fPIC -DPIC -o .libs/php_perl.o
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:172: warning: initialization from incompatible pointer type
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:173: warning: initialization from incompatible pointer type
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:199: warning: initialization from incompatible pointer type
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:200: warning: initialization from incompatible pointer type
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_zval_to_sv_ref’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:343: error: ‘zval’ has no member named ‘is_ref’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:350: error: ‘zval’ has no member named ‘is_ref’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_zval_to_sv_noref’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:393: error: ‘zval’ has no member named ‘is_ref’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:423: error: ‘zval’ has no member named ‘is_ref’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_sv_to_zval_ref’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:483: error: ‘zval’ has no member named ‘is_ref’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:485: error: ‘zval’ has no member named ‘refcount’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_sv_to_zval_noref’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:511: warning: passing argument 3 of ‘Perl_sv_2pv_flags’ from incompatible pointer type
/usr/lib/perl/5.10/CORE/proto.h:3039: note: expected ‘STRLEN *’ but argument is of type ‘int *’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:558: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘unsigned int’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_call_method’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:651: warning: passing argument 3 of ‘Perl_sv_2pv_flags’ from incompatible pointer type
/usr/lib/perl/5.10/CORE/proto.h:3039: note: expected ‘STRLEN *’ but argument is of type ‘int *’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_call’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:714: warning: passing argument 3 of ‘Perl_sv_2pv_flags’ from incompatible pointer type
/usr/lib/perl/5.10/CORE/proto.h:3039: note: expected ‘STRLEN *’ but argument is of type ‘int *’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_get’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:753: error: ‘zval’ has no member named ‘refcount’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_read_dimension’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:827: error: ‘zval’ has no member named ‘refcount’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:828: error: ‘zval’ has no member named ‘is_ref’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:836: error: ‘zval’ has no member named ‘refcount’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_read_property’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:976: error: ‘zval’ has no member named ‘refcount’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:993: error: ‘zval’ has no member named ‘refcount’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:1010: error: ‘zval’ has no member named ‘refcount’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:1088: error: ‘zval’ has no member named ‘refcount’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:1089: error: ‘zval’ has no member named ‘is_ref’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:1096: error: ‘zval’ has no member named ‘refcount’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_clone’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:1637: warning: format ‘%ld’ expects type ‘long int’, but argument 3 has type ‘unsigned int’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘php_perl_get_iterator’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:1758: error: ‘zval’ has no member named ‘refcount’
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘zm_startup_perl’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:1779: warning: assignment from incompatible pointer type
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘zm_info_perl’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:1805: warning: unknown conversion type character ‘v’ in format
/usr/local/src/php-perl/perl-1.0.0/php_perl.c: In function ‘zim_Perl_eval’:
/usr/local/src/php-perl/perl-1.0.0/php_perl.c:1867: warning: passing argument 3 of ‘Perl_sv_2pv_flags’ from incompatible pointer type
/usr/lib/perl/5.10/CORE/proto.h:3039: note: expected ‘STRLEN *’ but argument is of type ‘int *’
make: *** [php_perl.lo] Error 1
我在网上寻找所有这些问题的解决方案,但没有找到任何重大问题。有没有人之前解决过这个问题,或者知道什么是错的?
编辑:
这是我的程序的版本信息,如果有任何问题:
内核 - 2.6.32-27-通用
GCC - 4.4.3
梨 - 1.9.0
PHP - 5.3.2-1ubuntu4.5
Zend - 2.3.0
答案 0 :(得分:4)
管理以获得Pecl Perl模块安装成功
我将在Unix Flavor(Mac OS X Lion)中解释
Xcode
(用于编译器),因为它还将安装php源文件Macports
以安装re2c
包运行命令从php源创建符号链接到/usr/include
sudo ln -s /Developer/SDKs/MacOSX10.7.sdk/usr/include / usr / include
下载PECL PERL pakckage
从PECL SVN下载php_perl.c并覆盖之前下载的php_perl.c
cd进入文件夹
vi php_perl.h并添加
#define PHP_PERL_VERSION 0
运行这些命令
sudo phpize
./configure --with-perl=/usr/bin/perl --with-php-config=/usr/bin/php-config
sudo make
sudo make install
编辑php.ini以在动态扩展部分添加perl扩展
extension=perl.so
请记住,在Mac OS Lion中,.so项目将进入folde
/usr/lib/php/extensions/no-debug-non-zts-20090626/
重新启动apache并再次尝试phpinfo()
;
答案 1 :(得分:2)
这里有更新的来源:
http://svn.php.net/viewvc/pecl/perl/trunk/
由于某种原因从未打包到PECL包中。
PECL包装:2006-02-13
源代码:2009-10-06
尝试从这里下载php_perl.c:
http://svn.php.net/viewvc/pecl/perl/trunk/php_perl.c?view=co
将其放在您正在编译的位置,然后尝试另一个手动重新编译。
请注意,此模块可能被描述为“不稳定”。
另外:从同一个存储库下载php_perl.h:
http://svn.php.net/viewvc/pecl/perl/trunk/php_perl.h?view=co
然后编译作品。