Não é possível instalar a extensão pecl para perl no Ubuntu Server 12.10

2

Eu preciso chamar um script perl do meu arquivo php.

Eu tentei instalar a extensão PECL para o Perl.

Eu não tive sucesso.

Eu tentei o seguinte:

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

Estou executando um servidor Ubuntu 12,10. Minha versão do 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

Minha versão do 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

Atualização:

Eu tentei o último 23 de janeiro de 2013 Pecl instalar para Perl

Foi rotulado como 1.0.1

Eu recebi o seguinte depois de executar 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
    
por Kim Stacks 22.01.2013 / 06:06

1 resposta

1

Esta resposta funciona a partir de 29 de janeiro de 2013.

Primeiro de tudo, dentro do Ubuntu

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

para baixar o arquivo tgz do link

Descompacte o tar

tar -zxvf perl-1.0.1.tgz

Entre na pasta descompactada

cd perl-1.0.1

Remova o php_perl.c atual porque, por algum motivo, ele não funcionou com o meu php5.

Faça o download de outro php_perl.c do repositório do github link

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

Executar esta linha por linha

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  

Se você receber erros como /usr/bin/ld: cannot find -lperl , será necessário instalar

sudo apt-get install libperl-dev

Instale a extensão (esta etapa pode exigir privilégios de root)

make install

Adicione a extensão perl ao seu php.ini (esta etapa pode exigir privilégios de root)

extension=perl.so

Reinicie seu php5-fpm

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

Você pode ter problemas com a localidade quando executar o Perl.

Veja os locais ausentes. Supondo que você tenha perdido en_SG e en_SG.UTF-8

Tente

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

e, em seguida, reinicie.

Se você ainda tiver problemas de localidade,

Tente

sudo nano /etc/environment

Anexe o local ausente para LC_ALL

LC_ALL = "en_SG.UTF-8"

Reinicie.

Quero agradecer a tm064 do #perl e NullDev do #ubuntu por me ajudarem com essa solução.

    
por Kim Stacks 29.01.2013 / 05:02