Php: error: cURL version 7.10.5 or later is required to compile php with cURL support

Created on 14 May 2018  路  4Comments  路  Source: docker-library/php

Here is the Dockerfile:

FROM php:7.2.5-apache-stretch

RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev && \
docker-php-ext-configure gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ && \
docker-php-ext-install -j$(nproc) gd && \
docker-php-ext-install mysqli

COPY --chown=root:staff ./conf/php.ini /usr/local/etc/php/php.ini

And here is the complete log where I get the error when run "docker-php-ext-install curl":

Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
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/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20170718
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for cURL support... yes, shared
checking for pkg-config... /usr/bin/pkg-config
checking for libcurl.pc... using default path
checking for cURL 7.10.5 or greater... configure: error: cURL version 7.10.5 or later is required to compile php with cURL support

I'm missing something? What is the simplest way to test if the curl extension is working?

Thanks in advance!

Most helpful comment

cURL is preinstalled. Maybe you don't need to install again?

All 4 comments

cURL is preinstalled. Maybe you don't need to install again?

Indeed: :+1:

$ docker pull php:7.2-stretch
7.2-stretch: Pulling from library/php
Digest: sha256:a643c09e20c85c55e943cc31c2856874527b2797f7a2083a7c1fe57c5a19331d
Status: Image is up to date for php:7.2-stretch

$ docker run --rm php:7.2-stretch php -i | grep -i curl
Configure Command =>  './configure'  '--build=x86_64-linux-gnu' '--with-config-file-path=/usr/local/etc/php' '--with-config-file-scan-dir=/usr/local/etc/php/conf.d' '--enable-option-checking=fatal' '--disable-cgi' '--with-mhash' '--enable-ftp' '--enable-mbstring' '--enable-mysqlnd' '--with-password-argon2' '--with-sodium=shared' '--with-curl' '--with-libedit' '--with-openssl' '--with-zlib' '--with-libdir=lib/x86_64-linux-gnu' 'build_alias=x86_64-linux-gnu'
curl
cURL support => enabled
cURL Information => 7.52.1

So if cURL is already installed, why is there an error message saying a lower version needs to be installed?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mbates picture mbates  路  3Comments

ihorsamusenko picture ihorsamusenko  路  4Comments

2Kable picture 2Kable  路  3Comments

PMExtra picture PMExtra  路  3Comments

mikk150 picture mikk150  路  3Comments