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

发布于 2024-10-09 23:35:25 字数 7339 浏览 7 评论 0原文

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

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
禅德 - 2.3.0

I've tried going about this three different ways, none of them have worked. The first:

root@TheBad:/usr/local/src/# pecl install perl
Package "perl" Version "1.0.0" does not have REST xml available
install failed

Second method: Downloading the tar file and having pecl try to install that:

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

Third method: Extract the tar file, try to install manually:

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

I've looked online for solutions to all of these problems, but haven't found anything substantial. Has anyone worked through this problem before, or has any idea what's wrong?

Edit:
Here's version info for my programs, in case any of this matters:
Kernel - 2.6.32-27-generic
GCC - 4.4.3
PEAR - 1.9.0
PHP - 5.3.2-1ubuntu4.5
Zend - 2.3.0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

﹂绝世的画 2024-10-16 23:35:25

设法使 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

vi php_perl.h 并在 #endif 末尾

  • 运行这些命令

    <前><代码>sudo phpize
    ./configure --with-perl=/usr/bin/perl --with-php-config=/usr/bin/php-config
    须藤使
    须藤进行安装

编辑 php.ini 以在动态扩展部分添加 perl 扩展

extension=perl.so

请记住,在 Mac OS Lion 中,.so 项目将进入文件夹

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

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

Manage to get Pecl Perl Module installation success

I'll explain in Unix Flavor (Mac OS X Lion)

  • Install Xcode (for compiler) and as it will also install php source file
  • Install Macports to install re2c package
  • run command to create symlinks from php source to /usr/include

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

  • Download PECL PERL pakckage

  • Download php_perl.c from PECL SVN and overwrite the previous downloaded php_perl.c

  • cd into the folder

  • vi php_perl.h and add

    #define PHP_PERL_VERSION 0 
    

before the end of #endif

  • run these command

    sudo phpize
    ./configure --with-perl=/usr/bin/perl --with-php-config=/usr/bin/php-config
    sudo make
    sudo make install
    

edit php.ini to add a perl extension at the dynamic extension part

extension=perl.so

bear in mind that in Mac OS Lion, the .so item will go into folde

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

restart apache and try again your phpinfo();

樱花细雨 2024-10-16 23:35:25

这里有较新的来源:

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

然后编译就可以了。

There is newer source here:

http://svn.php.net/viewvc/pecl/perl/trunk/

which was never packed up into the PECL package for some reason.

PECL package: 2006-02-13

Source code: 2009-10-06

Try downloading php_perl.c from here:

http://svn.php.net/viewvc/pecl/perl/trunk/php_perl.c?view=co

drop it in where you're compiling and then try another manual re-compile.

Note that this module could be described as "unstable".


Also: download php_perl.h from the same repository:

http://svn.php.net/viewvc/pecl/perl/trunk/php_perl.h?view=co

Then compiling works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文