1 votos

La instalación de pecl_http en PHP 7.3 / Debian 9 Stretch falla

Estoy tratando de instalar pecl_http en PHP 7.3, sin embargo, hay un error:

root@dev:/etc/php/7.3/mods-available# pecl install pecl_http
downloading pecl_http-3.2.0.tgz ...
Starting to download pecl_http-3.2.0.tgz (218,829 bytes)
.............................................done: 218,829 bytes
84 source files, building
running: phpize
Configuring for:
PHP Api Version:         20180731
Zend Module Api No:      20180731
Zend Extension Api No:   320180731
where to find zlib [/usr] : 
where to find libcurl [/usr] : 
where to find libevent [/usr] : 
where to find libicu [/usr] : 
where to find libidn2 [/usr] : 
where to find libidn [/usr] : 
where to find libidnkit2 [/usr] : 
where to find libidnkit [/usr] : 
building in /tmp/pear/temp/pear-build-rooti6U7fE/pecl_http-3.2.0
running: /tmp/pear/temp/pecl_http/configure --with-php-config=/usr/bin/php-config --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/usr --with-http-libicu-dir=/usr --with-http-libidn2-dir=/usr --with-http-libidn-dir=/usr --with-http-libidnkit2-dir=/usr --with-http-libidnkit-dir=/usr
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-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib
checking for PHP extension directory... /usr/lib/php/20180731
checking for PHP installed headers prefix... /usr/include/php/20180731
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... gawk
checking whether to enable extended HTTP support... yes, shared
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 off_t... yes
checking for mbstate_t... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for unistd.h... (cached) yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking wctype.h usability... yes
checking wctype.h presence... yes
checking for wctype.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking for gethostname... yes
checking for getdomainname... yes
checking for mbrtowc... yes
checking for mbtowc... yes
checking for iswalnum... yes
checking for inet_pton... yes
checking whether/where to check for zlib... /usr
checking for gawk... (cached) gawk
checking for zlib... 1.2.8
checking whether zlib version 1.2.8 >= 1.2.0.4... ok
checking whether/where to check for libbrotli... yes
checking for pkg-config... /usr/bin/pkg-config
checking for libbrotlicommon... no
checking whether libbrotlicommon version  >= 1.0... no
checking for libbrotlidec... no
checking whether libbrotlidec version  >= 1.0... no
checking for libbrotlienc... no
checking whether libbrotlienc version  >= 1.0... no
checking whether/where to check for libcurl... /usr
checking for a sed that does not truncate output... (cached) /bin/sed
checking for egrep... (cached) /bin/grep -E
checking for curl-config... false
checking for libcurl... no
checking whether libcurl version  >= 7.18.2... configure: error: no
ERROR: `/tmp/pear/temp/pecl_http/configure --with-php-config=/usr/bin/php-config --with-http-zlib-dir=/usr --with-http-libcurl-dir=/usr --with-http-libevent-dir=/usr --with-http-libicu-dir=/usr --with-http-libidn2-dir=/usr --with-http-libidn-dir=/usr --with-http-libidnkit2-dir=/usr --with-http-libidnkit-dir=/usr' failed

En primer lugar, ¿por qué me piden la ubicación de varias bibliotecas? A continuación, se produce un error en configure.

/etc/apt/sources.lista.d/php-sury.org.la lista contiene:

deb https://packages.sury.org/php/ stretch main

disponible módulos PHP:

root@dev:/etc/php/7.3/mods-available# l
insgesamt 192K
drwxr-xr-x 2 root root 4,0K Jan  5 03:50 ./
drwxr-xr-x 5 root root 4,0K Jul 22  2018 ../
-rw-r--r-- 1 root root   74 Jul 17  2018 calendar.ini
-rw-r--r-- 1 root root   71 Jul 17  2018 ctype.ini
-rw-r--r-- 1 root root   68 Jul 17  2018 curl.ini
-rw-r--r-- 1 root root   66 Jul 17  2018 dom.ini
-rw-r--r-- 1 root root   70 Jul 17  2018 exif.ini
-rw-r--r-- 1 root root   74 Jul 17  2018 fileinfo.ini
-rw-r--r-- 1 root root   69 Jul 17  2018 ftp.ini
-rw-r--r-- 1 root root   64 Jul 17  2018 gd.ini
-rw-r--r-- 1 root root   73 Jul 17  2018 gettext.ini
-rw-r--r-- 1 root root   71 Jul 17  2018 iconv.ini
-rw-r--r-- 1 root root   68 Dez 17 10:26 imap.ini
-rw-r--r-- 1 root root   68 Jul 17  2018 intl.ini
-rw-r--r-- 1 root root   68 Jul 17  2018 json.ini
-rw-r--r-- 1 root root   71 Jul 17  2018 mysqli.ini
-rw-r--r-- 1 root root   72 Jul 17  2018 mysqlnd.ini
-rw-r--r-- 1 root root   68 Jul 17  2018 odbc.ini
-rw-r--r-- 1 root root   79 Jul 17  2018 opcache.ini
-rw-r--r-- 1 root root   69 Jul 17  2018 pdo.ini
-rw-r--r-- 1 root root   74 Jul 17  2018 pdo_mysql.ini
-rw-r--r-- 1 root root   72 Jul 17  2018 pdo_odbc.ini
-rw-r--r-- 1 root root   74 Jul 17  2018 pdo_pgsql.ini
-rw-r--r-- 1 root root   77 Jul 17  2018 pdo_sqlite.ini
-rw-r--r-- 1 root root   70 Jul 17  2018 pgsql.ini
-rw-r--r-- 1 root root   70 Jul 17  2018 phar.ini
-rw-r--r-- 1 root root   71 Jul 17  2018 posix.ini
-rw-r--r-- 1 root root   20 Aug 19 17:08 propro.ini
-rw-r--r-- 1 root root   19 Aug 19 17:08 raphf.ini
-rw-r--r-- 1 root root   76 Jul 17  2018 readline.ini
-rw-r--r-- 1 root root   71 Jul 17  2018 shmop.ini
-rw-r--r-- 1 root root   72 Jul 17  2018 simplexml.ini
-rw-r--r-- 1 root root   68 Jul 17  2018 soap.ini
-rw-r--r-- 1 root root   73 Jul 17  2018 sockets.ini
-rw-r--r-- 1 root root   74 Jul 17  2018 sqlite3.ini
-rw-r--r-- 1 root root   73 Jul 17  2018 sysvmsg.ini
-rw-r--r-- 1 root root   73 Jul 17  2018 sysvsem.ini
-rw-r--r-- 1 root root   73 Jul 17  2018 sysvshm.ini
-rw-r--r-- 1 root root   68 Jul 17  2018 tidy.ini
-rw-r--r-- 1 root root   75 Jul 17  2018 tokenizer.ini
-rw-r--r-- 1 root root   67 Jul 17  2018 wddx.ini
-rw-r--r-- 1 root root   25 Okt 19 09:02 xdebug.ini
-rw-r--r-- 1 root root   66 Jul 17  2018 xml.ini
-rw-r--r-- 1 root root   72 Jul 17  2018 xmlreader.ini
-rw-r--r-- 1 root root   72 Jul 17  2018 xmlrpc.ini
-rw-r--r-- 1 root root   72 Jul 17  2018 xmlwriter.ini
-rw-r--r-- 1 root root   66 Jul 17  2018 xsl.ini
-rw-r--r-- 1 root root   66 Jul 17  2018 zip.ini

cargado módulos PHP:

root@dev:/etc/php/7.3/mods-available# php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imap
intl
json
libxml
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
propro
raphf
readline
Reflection
session
shmop
SimpleXML
soap
sockets
sodium
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

Las alternativas se establecen a PHP7.3 como predeterminado

root@dev:/etc/php/7.3/mods-available# l /etc/alternatives/php*
lrwxrwxrwx 1 root root 15 Jul 22  2018 /etc/alternatives/php -> /usr/bin/php7.3*
lrwxrwxrwx 1 root root 31 Jul 22  2018 /etc/alternatives/php.1.gz -> /usr/share/man/man1/php7.3.1.gz
lrwxrwxrwx 1 root root 22 Nov 27 03:08 /etc/alternatives/php-config -> /usr/bin/php-config7.3*
lrwxrwxrwx 1 root root 38 Nov 27 03:08 /etc/alternatives/php-config.1.gz -> /usr/share/man/man1/php-config7.3.1.gz
lrwxrwxrwx 1 root root 18 Nov 27 03:08 /etc/alternatives/phpize -> /usr/bin/phpize7.3*
lrwxrwxrwx 1 root root 34 Nov 27 03:08 /etc/alternatives/phpize.1.gz -> /usr/share/man/man1/phpize7.3.1.gz

No tengo idea de lo que está pasando aquí. Tiene alguien alguna idea de por qué falla la instalación?

2voto

Michael Hampton Puntos 88271

El script de configuración le dijo exactamente cuál es el error:

 checking whether libcurl version  >= 7.18.2... configure: error: no
 

Su sistema no tiene el paquete dev adecuado para compilar software. Necesitas instalar estos paquetes dev primero.

 sudo apt install libcurl-dev
 

1voto

Quasimodo's clone Puntos 121

Pasos adicionales para sistemas Debian:

He seguido a Michael Hampton's respuesta. De hecho, el paquete virtual libcurl-dev que faltaba. Después de la instalación a través del sistema de gestión de paquetes pecl install pecl_http trabajó como un encanto.

Sin embargo, la configuración en debian no es hecho por pecl automáticamente. Yo necesitaba para crear manualmente un archivo de configuración

/etc/php/7.3/mods-available con el contenido:

; configuration for php http module
; priority=20
extension=http.so

Y entonces yo era capaz de habilitar el módulo de con phpenmod http que crea enlaces simbólicos en la conf.d carpetas.

EnMiMaquinaFunciona.com

EnMiMaquinaFunciona es una comunidad de administradores de sistemas en la que puedes resolver tus problemas y dudas.
Puedes consultar las preguntas de otros sysadmin, hacer tus propias preguntas o resolver las de los demás.

Powered by: