Невозможно установить расширение pecl для perl в Ubuntu Server 12.10.

Мне нужно вызвать Perl-скрипт из моего php-файла.

Я попытался установить расширение PECL для Perl.

Я был неудачным.

Я попробовал следующее:

pecl channel-update pear.php.net
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded


pecl install perl
downloading perl-1.0.0.tgz ...
Starting to download perl-1.0.0.tgz (24,358 bytes)
.....done: 24,358 bytes
Validation Error: No release notes found
Parsing of package.xml from file "/tmp/pear/temp/peartf4IJH/package.xml" failed
Download of "pecl/perl" succeeded, but it is not a valid package archive
Error: cannot download "pear/perl"
Download failed
install failed

Я использую сервер Ubuntu 12.10. Моя версия PHP -

PHP 5.4.6-1ubuntu1.1 (cli) (built: Nov 15 2012 01:18:34) 
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

Моя версия Perl -

This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi
(with 64 registered patches, see perl -V for more detail)

Copyright 1987-2011, Larry Wall

Обновление:

Я пытался установить последнюю версию Pecl 23 января 2013 Perl

Он был помечен как 1.0.1

Я получил следующее после запуска pecl install perl

downloading perl-1.0.1.tgz ...
Starting to download perl-1.0.1.tgz (25,282 bytes)
.........done: 25,282 bytes
5 source files, building
running: phpize
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = "en_SG:en",
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_SG.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = "en_SG:en",
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_SG.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
building in /tmp/pear/temp/pear-build-rootcxwYP8/perl-1.0.1
running: /tmp/pear/temp/perl/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
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -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
checking for PHP extension directory... /usr/lib/php5/20100525
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for perl support... yes, shared
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) nawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear/temp/pear-build-rootcxwYP8/perl-1.0.1/libtool --mode=compile cc  -I. -I/tmp/pear/temp/perl -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootcxwYP8/perl-1.0.1/include -I/tmp/pear/temp/pear-build-rootcxwYP8/perl-1.0.1/main -I/tmp/pear/temp/perl -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 -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.14/CORE  -c /tmp/pear/temp/perl/php_perl.c -o php_perl.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/perl -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootcxwYP8/perl-1.0.1/include -I/tmp/pear/temp/pear-build-rootcxwYP8/perl-1.0.1/main -I/tmp/pear/temp/perl -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 -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.14/CORE -c /tmp/pear/temp/perl/php_perl.c  -fPIC -DPIC -o .libs/php_perl.o
/tmp/pear/temp/perl/php_perl.c:186:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:186:3: warning: (near initialization for 'php_perl_object_handlers.read_property') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:187:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:187:3: warning: (near initialization for 'php_perl_object_handlers.write_property') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:193:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:193:3: warning: (near initialization for 'php_perl_object_handlers.has_property') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:194:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:194:3: warning: (near initialization for 'php_perl_object_handlers.unset_property') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:198:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:198:3: warning: (near initialization for 'php_perl_object_handlers.get_method') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:199:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:199:3: warning: (near initialization for 'php_perl_object_handlers.call_method') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:202:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:202:3: warning: (near initialization for 'php_perl_object_handlers.get_class_name') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:213:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:213:3: warning: (near initialization for 'php_perl_proxy_handlers.read_property') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:214:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:214:3: warning: (near initialization for 'php_perl_proxy_handlers.write_property') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:220:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:220:3: warning: (near initialization for 'php_perl_proxy_handlers.has_property') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:221:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:221:3: warning: (near initialization for 'php_perl_proxy_handlers.unset_property') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:225:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:225:3: warning: (near initialization for 'php_perl_proxy_handlers.get_method') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:226:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:226:3: warning: (near initialization for 'php_perl_proxy_handlers.call_method') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:229:3: warning: initialization from incompatible pointer type [enabled by default]
/tmp/pear/temp/perl/php_perl.c:229:3: warning: (near initialization for 'php_perl_proxy_handlers.get_class_name') [enabled by default]
/tmp/pear/temp/perl/php_perl.c:247:1: warning: excess elements in struct initializer [enabled by default]
/tmp/pear/temp/perl/php_perl.c:247:1: warning: (near initialization for 'php_perl_constructor_function') [enabled by default]
/tmp/pear/temp/perl/php_perl.c: In function 'php_perl_sv_to_zval_noref':
/tmp/pear/temp/perl/php_perl.c:540:7: warning: passing argument 3 of 'Perl_sv_2pv_flags' from incompatible pointer type [enabled by default]
In file included from /usr/lib/perl/5.14/CORE/perl.h:5036:0,
                 from /tmp/pear/temp/perl/php_perl.c:38:
/usr/lib/perl/5.14/CORE/proto.h:3565:21: note: expected 'STRLEN * const' but argument is of type 'int *'
/tmp/pear/temp/perl/php_perl.c:587:18: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'unsigned int' [-Wformat]
/tmp/pear/temp/perl/php_perl.c: In function 'php_perl_call_method':
/tmp/pear/temp/perl/php_perl.c:680:11: warning: passing argument 3 of 'Perl_sv_2pv_flags' from incompatible pointer type [enabled by default]
In file included from /usr/lib/perl/5.14/CORE/perl.h:5036:0,
                 from /tmp/pear/temp/perl/php_perl.c:38:
/usr/lib/perl/5.14/CORE/proto.h:3565:21: note: expected 'STRLEN * const' but argument is of type 'int *'
/tmp/pear/temp/perl/php_perl.c: In function 'php_perl_call':
/tmp/pear/temp/perl/php_perl.c:743:11: warning: passing argument 3 of 'Perl_sv_2pv_flags' from incompatible pointer type [enabled by default]
In file included from /usr/lib/perl/5.14/CORE/perl.h:5036:0,
                 from /tmp/pear/temp/perl/php_perl.c:38:
/usr/lib/perl/5.14/CORE/proto.h:3565:21: note: expected 'STRLEN * const' but argument is of type 'int *'
/tmp/pear/temp/perl/php_perl.c: In function 'php_perl_get_method':
/tmp/pear/temp/perl/php_perl.c:1418:5: error: too few arguments to function 'zend_get_std_object_handlers()->get_method'
/tmp/pear/temp/perl/php_perl.c: In function 'php_perl_get_properties':
/tmp/pear/temp/perl/php_perl.c:1496:29: error: 'znode_op' has no member named 'op_type'
/tmp/pear/temp/perl/php_perl.c:1497:29: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c:1498:12: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c:1498:12: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c:1499:12: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c:1499:12: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c:1500:12: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c:1500:12: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c:1501:12: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c:1501:12: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c:1502:12: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c:1502:12: error: 'znode_op' has no member named 'u'
/tmp/pear/temp/perl/php_perl.c: In function 'php_perl_clone':
/tmp/pear/temp/perl/php_perl.c:1666:7: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'unsigned int' [-Wformat]
/tmp/pear/temp/perl/php_perl.c: In function 'zm_info_perl':
/tmp/pear/temp/perl/php_perl.c:1843:3: warning: unknown conversion type character 'v' in format [-Wformat]
/tmp/pear/temp/perl/php_perl.c: In function 'zim_Perl_eval':
/tmp/pear/temp/perl/php_perl.c:1905:13: warning: passing argument 3 of 'Perl_sv_2pv_flags' from incompatible pointer type [enabled by default]
In file included from /usr/lib/perl/5.14/CORE/perl.h:5036:0,
                 from /tmp/pear/temp/perl/php_perl.c:38:
/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
ERROR: `make' failed
www-data@ubuntu-server:/var/virtual/storyzer.com/testperl$ exit
logout
2
задан 25 April 2014 в 20:34

1 ответ

Этот ответ работает с 29 января 2013.

В первую очередь, в человечности делают

wget http://pecl.php.net/get/perl-1.0.1.tgz

загружать tgz файл с http://pecl.php.net/package/perl

Разархивируйте tar

tar -zxvf perl-1.0.1.tgz

Войдите в несжатую папку

cd perl-1.0.1

Удалите текущий php_perl.c, потому что по некоторым причинам, он не работал с моим php5.

Загрузите другой php_perl.c с GitHub repo https://github.com/do-aki/php-ext-perl

wget https://raw.github.com/do-aki/php-ext-perl/a3d7db22eb7964ea9cb39ea2f866d10df26655d4/php_perl.c

Выполните это линию за линией

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  

Если Вы получаете ошибки как /usr/bin/ld: cannot find -lperl, затем необходимо установить

sudo apt-get install libperl-dev

Установите расширение (этот шаг может потребовать полномочий пользователя root),

make install

Добавьте расширение жемчуга в свой php.ini (этот шаг может потребовать полномочий пользователя root),

extension=perl.so

Перезапустите свой php5-fpm

sudo /etc/init.d/php5-fpm restart

Можно заставить проблемы делать с локалью при выполнении Perl.

Посмотрите на недостающие локали. Принятие Вас имеет пропавших без вести en_SG и en_SG.UTF-8

Попробовать

sudo locale-gen en_SG en_SG.UTF-8
sudo dpkg-reconfigure locales

и затем перезагрузка.

Если у Вас все еще есть проблемы локали,

Попробовать

sudo nano /etc/environment

Добавьте недостающую локаль к LC_ALL

LC_ALL = "en_SG.UTF-8"

Перезагрузка.

Я хочу благодарить tm064 от #perl и NullDev от #ubuntu для помощи мне с этим решением.

1
ответ дан 25 April 2014 в 20:34

Другие вопросы по тегам:

Похожие вопросы: