gpt4 book ai didi

php - 有人成功安装了 php-perl 扩展吗?

转载 作者:行者123 更新时间:2023-12-02 08:56:22 29 4
gpt4 key购买 nike

我尝试过三种不同的方法,但没有一种有效。第一个:

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-generic
海湾合作委员会 - 4.4.3
梨 - 1.9.0
PHP - 5.3.2-1ubuntu4.5
Zend - 2.3.0

最佳答案

设法使 Pecl Perl Module 安装成功

我会用 Unix Flavor (Mac OS X Lion) 来解释

  • 安装Xcode(用于编译器),因为它还将安装 php 源文件
  • 安装Macports以安装re2c软件包
  • 运行命令创建从 php 源到 /usr/include 的符号链接(symbolic link)

    sudo ln -s/Developer/SDKs/MacOSX10.7.sdk/usr/include/usr/include

  • 下载 PECL PERL 软件包

  • 从PECL SVN下载php_perl.c并覆盖之前下载的php_perl.c

  • cd 进入文件夹

  • vi php_perl.h 并添加

    #define PHP_PERL_VERSION 0 

#endif 结束之前

  • 运行这些命令

    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 项目将进入文件夹

/usr/lib/php/extensions/no-debug-non-zts-20090626/

重新启动 apache 并再次尝试 phpinfo();

关于php - 有人成功安装了 php-perl 扩展吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4550135/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com