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.

5
  • Maybe this: stackoverflow.com/a/37100588/1158599 ? Commented Nov 2, 2016 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. Commented Nov 2, 2016 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? Commented Nov 2, 2016 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..... ? Commented Nov 3, 2016 at 15:49
  • php 7.1 comes with libcurl >= 7.44.0 so never mind :) Commented Nov 14, 2016 at 15:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.