1

I'm able to upgrade the cURL binary and libs, however PHP still utilizes the old version.

cURL binary and libs PHP cURL

I'm building on top of the official php:7.0-fpm docker container.

First, I've upgraded cURL:

RUN curl -fsSL 'https://curl.haxx.se/download/curl-7.50.3.tar.gz' -o curl.tar.gz \
    && mkdir -p curl \
    && tar -xf curl.tar.gz -C curl --strip-components=1 \
    && rm curl.tar.gz \
    && ( \
        cd curl \
        && make \
        && make install \
        && ldconfig \
    ) \
    && rm -r curl 

I've tried:

  1. Use libtool

    cd curl \
    && ./buildconf \
    && ./configure \
    # ...
    
  2. Re-install curl for PHP

    RUN docker-php-ext-configure curl --with-curl=/usr/local/lib
    RUN docker-php-ext-install curl
    

But this throws the error/warning: warning: curl (curl.so) is already loaded! and eventually just ignores that I want to reinstall it.

  1. Several smaller random stuff

If possible, I'm looking for a solution that doesn't require a complete recompile of PHP.

arubacao
  • 143
  • 1
  • 6
  • Maybe this: http://stackoverflow.com/a/37100588/1158599 ? – S.I. Nov 02 '16 at 12:53
  • The cURL PHP extension is linked against the cURL library, just like the cURL binary, however, those too are independent and upgrading either doesn't upgrade the other. So you need to build the PHP extension. Also, you must use `https` instead. It's a shame for a developer and a security issue to use unencrypted protocols for downloading critical software. – Daniel W. Nov 02 '16 at 15:02
  • Wow, that escalated quickly - but thanks for pointing it out ;) As shown in 2: `RUN docker-php-ext-install curl` didn't do the trick. Any better ideas? – arubacao Nov 02 '16 at 23:34
  • No offense intended ;-) I am not sure if you can compile the curl.so without fully rebuilding PHP from source. Have you tried removing curl before running `RUN docker-php-ext.....` ? – Daniel W. Nov 03 '16 at 15:49
  • php 7.1 comes with libcurl >= 7.44.0 so never mind :) – arubacao Nov 14 '16 at 15:41

0 Answers0