php:7.0-fpm curl

Created on 27 Oct 2016  路  11Comments  路  Source: docker-library/php

php:7.0-fpm
With RUN docker-php-ext-install curl in my Dockerfile I get following error

configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/

I tried to fix it by adding RUN apt-get install -y libcurl3 but that didn't work.

Full log:

Step 6 : RUN docker-php-ext-install curl
---> Running in 2366eeb49d53

  • cd /usr/src/php/ext/curl
  • phpize
    Configuring for:
    PHP Api Version: 20151012
    Zend Module Api No: 20151012
    Zend Extension Api No: 320151012
  • ./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/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-20151012
    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.13.5 (ok)
    checking for gawk... no
    checking for nawk... nawk
    checking if nawk is broken... no
    checking for cURL support... yes, shared
    checking for cURL in default path... not found
    configure: error: Please reinstall the libcurl distribution -
    easy.h should be in /include/curl/
    ERROR: Service 'php' failed to build: The command '/bin/sh -c docker-php-ext-install curl' returned a non-zero code: 1

Most helpful comment

@60days you need curl-dev package. :smile:

All 11 comments

I guess curl is alread installed. However, you need the curl dev lib.

You may need to run apt-get update but you will certainly need apt-get install libcurl3-dev :)

apt-get update did nothing. I did install libcurl4-openssl-dev and it fixed it I tought it would have been installed already as buildDep as run here

Just a note that we have found this issue has recently broken a previously working image based on php:7.0-fpm-alpine .

libcurl does exist on the alpine package repo, but no -dev versions, and installing it does not resolve the issue.

Though I can't identify the exact commit that caused this, our builds began failing in the last 48hrs.

This dockerfile will replicate:

FROM php:7.0-fpm-alpine

RUN apk add --update --no-cache \
libcurl \
curl

RUN docker-php-ext-install curl
CMD ["/bin/sh"] 

@60days you need curl-dev package. :smile:

Thanks! that resolved it for me though I'm now onto some errors from phpize which I assume are unrelated to this project.

Any idea what would have precipitated the change? It might help me resolve my other issues.

@60days, The most recent change was: https://github.com/docker-library/php/pull/334 to fix https://github.com/docker-library/php/issues/322. Which might expose failures that were happening previously but being incorrectly ignored.

There was also the addition of the 7.1 release making php:7-fpm-alpine contain 7.1, but your example used a more specific version than 7.

Yep, I think thats exactly what happened (and with the other errors I now have). Luckily it seems the extensions that fail are not actually required by our software any more.

There may be other alpine-users showing up with similar issue reports soon though (we build a few times a day so it showed up early for us). Thanks for the help.

Yeah, thanks for the heads up @60days -- hopefully the impact won't be too great :sweat_smile:

I'm going to go ahead and close this, since the curl extension, once installed, appears to be working properly. :+1:

Try apt-get install libcurl4-gnutls-dev . Works fine for me as well

Was this page helpful?
0 / 5 - 0 ratings

Related issues

igodorogea picture igodorogea  路  3Comments

nojimage picture nojimage  路  3Comments

cordoval picture cordoval  路  3Comments

mcnesium picture mcnesium  路  3Comments

yosifkit picture yosifkit  路  3Comments