我按照这个线程中的答案来制作 php 的 perl 模块。
我使用的是 ubuntu 12.10。无法使用 PHP_PERL 扩展。也无法安装该扩展
简要步骤如下:
export PHP_PREFIX="/usr"
export PERL_PREFIX="/usr"
$PHP_PREFIX/bin/phpize
./configure --with-perl=$PERL_PREFIX --with-php-config=$PHP_PREFIX/bin/php-config
make
我在 make 时收到以下错误。
我在 ubuntu 12.04 x64 上
ubuntu@myhostname:/software/perl-1.0.1$ make
/bin/bash /software/perl-1.0.1/libtool --mode=compile cc -I. -I/software/perl-1.0.1 -DPHP_ATOM_INC -I/software/perl-1.0.1/include -I/software/perl-1.0.1/main -I/software/perl-1.0.1 -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.14/CORE -c /software/perl-1.0.1/php_perl.c -o php_perl.lo
libtool: compile: cc -I. -I/software/perl-1.0.1 -DPHP_ATOM_INC -I/software/perl-1.0.1/include -I/software/perl-1.0.1/main -I/software/perl-1.0.1 -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.14/CORE -c /software/perl-1.0.1/php_perl.c -fPIC -DPIC -o .libs/php_perl.o
/software/perl-1.0.1/php_perl.c:208:3: warning: initialization from incompatible pointer type [enabled by default]
/software/perl-1.0.1/php_perl.c:208:3: warning: (near initialization for 'php_perl_object_handlers.call_method') [enabled by default]
/software/perl-1.0.1/php_perl.c:211:3: warning: initialization from incompatible pointer type [enabled by default]
/software/perl-1.0.1/php_perl.c:211:3: warning: (near initialization for 'php_perl_object_handlers.get_class_name') [enabled by default]
/software/perl-1.0.1/php_perl.c:235:3: warning: initialization from incompatible pointer type [enabled by default]
/software/perl-1.0.1/php_perl.c:235:3: warning: (near initialization for 'php_perl_proxy_handlers.call_method') [enabled by default]
/software/perl-1.0.1/php_perl.c:238:3: warning: initialization from incompatible pointer type [enabled by default]
/software/perl-1.0.1/php_perl.c:238:3: warning: (near initialization for 'php_perl_proxy_handlers.get_class_name') [enabled by default]
/software/perl-1.0.1/php_perl.c: In function 'php_perl_sv_to_zval_noref':
/software/perl-1.0.1/php_perl.c:554:7: warning: passing argument 3 of 'Perl_sv_2pv_flags' from incompatible pointer type [enabled by default]
/usr/lib/perl/5.14/CORE/proto.h:3565:21: note: expected 'STRLEN * const' but argument is of type 'int *'
/software/perl-1.0.1/php_perl.c:601:18: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'unsigned int' [-Wformat]
/software/perl-1.0.1/php_perl.c: In function 'php_perl_call_method':
/software/perl-1.0.1/php_perl.c:694:11: warning: passing argument 3 of 'Perl_sv_2pv_flags' from incompatible pointer type [enabled by default]
/usr/lib/perl/5.14/CORE/proto.h:3565:21: note: expected 'STRLEN * const' but argument is of type 'int *'
/software/perl-1.0.1/php_perl.c: In function 'php_perl_call':
/software/perl-1.0.1/php_perl.c:757:11: warning: passing argument 3 of 'Perl_sv_2pv_flags' from incompatible pointer type [enabled by default]
/usr/lib/perl/5.14/CORE/proto.h:3565:21: note: expected 'STRLEN * const' but argument is of type 'int *'
/software/perl-1.0.1/php_perl.c: In function 'php_perl_write_property':
/software/perl-1.0.1/php_perl.c:1194:11: error: 'value' undeclared (first use in this function)
/software/perl-1.0.1/php_perl.c:1194:11: note: each undeclared identifier is reported only once for each function it appears in
/software/perl-1.0.1/php_perl.c: In function 'php_perl_get_properties':
/software/perl-1.0.1/php_perl.c:1546:24: error: 'zend_op' has no member named 'op1_type'
/software/perl-1.0.1/php_perl.c:1547:29: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c:1548:12: error: 'znode' has no member named 'literal'
/software/perl-1.0.1/php_perl.c:1548:12: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c:1548:12: error: 'znode' has no member named 'literal'
/software/perl-1.0.1/php_perl.c:1548:12: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c:1549:12: error: 'znode' has no member named 'literal'
/software/perl-1.0.1/php_perl.c:1549:12: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c:1549:12: error: 'znode' has no member named 'literal'
/software/perl-1.0.1/php_perl.c:1549:12: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c:1550:12: error: 'znode' has no member named 'literal'
/software/perl-1.0.1/php_perl.c:1550:12: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c:1550:12: error: 'znode' has no member named 'literal'
/software/perl-1.0.1/php_perl.c:1550:12: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c:1551:12: error: 'znode' has no member named 'literal'
/software/perl-1.0.1/php_perl.c:1551:12: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c:1551:12: error: 'znode' has no member named 'literal'
/software/perl-1.0.1/php_perl.c:1551:12: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c:1552:12: error: 'znode' has no member named 'literal'
/software/perl-1.0.1/php_perl.c:1552:12: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c:1552:12: error: 'znode' has no member named 'literal'
/software/perl-1.0.1/php_perl.c:1552:12: error: 'znode' has no member named 'constant'
/software/perl-1.0.1/php_perl.c: In function 'php_perl_get_class_name':
/software/perl-1.0.1/php_perl.c:1606:5: warning: passing argument 1 of 'strcpy' discards 'const' qualifier from pointer target type [enabled by default]
/usr/include/x86_64-linux-gnu/bits/string3.h:103:1: note: expected 'char * __restrict__' but argument is of type 'const char *'
/software/perl-1.0.1/php_perl.c:1618:7: warning: passing argument 1 of 'strcpy' discards 'const' qualifier from pointer target type [enabled by default]
/usr/include/x86_64-linux-gnu/bits/string3.h:103:1: note: expected 'char * __restrict__' but argument is of type 'const char *'
/software/perl-1.0.1/php_perl.c:1619:7: warning: passing argument 1 of 'strcpy' discards 'const' qualifier from pointer target type [enabled by default]
/usr/include/x86_64-linux-gnu/bits/string3.h:103:1: note: expected 'char * __restrict__' but argument is of type 'const char *'
/software/perl-1.0.1/php_perl.c:1624:7: warning: passing argument 1 of 'strcpy' discards 'const' qualifier from pointer target type [enabled by default]
/usr/include/x86_64-linux-gnu/bits/string3.h:103:1: note: expected 'char * __restrict__' but argument is of type 'const char *'
/software/perl-1.0.1/php_perl.c:1629:7: warning: passing argument 1 of 'strcpy' discards 'const' qualifier from pointer target type [enabled by default]
/usr/include/x86_64-linux-gnu/bits/string3.h:103:1: note: expected 'char * __restrict__' but argument is of type 'const char *'
/software/perl-1.0.1/php_perl.c:1634:7: warning: passing argument 1 of 'strcpy' discards 'const' qualifier from pointer target type [enabled by default]
/usr/include/x86_64-linux-gnu/bits/string3.h:103:1: note: expected 'char * __restrict__' but argument is of type 'const char *'
/software/perl-1.0.1/php_perl.c: In function 'php_perl_clone':
/software/perl-1.0.1/php_perl.c:1716:7: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'unsigned int' [-Wformat]
/software/perl-1.0.1/php_perl.c: In function 'zm_info_perl':
/software/perl-1.0.1/php_perl.c:1893:3: warning: unknown conversion type character 'v' in format [-Wformat]
/software/perl-1.0.1/php_perl.c: In function 'zim_Perl_eval':
/software/perl-1.0.1/php_perl.c:1955:13: warning: passing argument 3 of 'Perl_sv_2pv_flags' from incompatible pointer type [enabled by default]
/usr/lib/perl/5.14/CORE/proto.h:3565:21: note: expected 'STRLEN * const' but argument is of type 'int *'
make: *** [php_perl.lo] Error 1
答案1
我从以下网址下载的修补后的 .c 文件与 .h 文件不再匹配,因此存在编译问题。这意味着我必须自己修补它,或者等待该项目更新。
获得https://raw.github.com/do-aki/php-ext-perl/a3d7db22eb7964ea9cb39ea2f866d10df26655d4/php_perl.c
现已损坏