Code Monkey home page Code Monkey logo

Comments (3)

davidalger avatar davidalger commented on May 20, 2024

Not sure this will be as simple as installing a later version of curl, as I believe PHP links to curl at compile time. However, it appears that it's linking to libcurl.so.4 which should allow PHP to run with the latest libcurl.

Install inside your container from city-fan (which is linked to from http://curl.haxx.se/ as providing a more current curl than is provided by RHEL 7 sources):

rpm -Uvh http://www.city-fan.org/ftp/contrib/yum-repo/rhel7/x86_64/city-fan.org-release-2-1.rhel7.noarch.rpm
yum install -y yum-utils
yum-config-manager --disable city-fan.org
yum --enablerepo=city-fan.org install libcurl libcurl-devel

Source: https://www.mysterydata.com/update-install-latest-curl-version-on-rhel-8-rhel-7-centos-7-8-cwp-vestacp-cpanel-plesk/

With this done, you'll be able to see the latest version available in PHP:

# php --ri curl

curl

cURL support => enabled
cURL Information => 7.75.0

...

PHP still would not know about the new constants however, given it was compiled against the older version. You might try installing the later version something along the lines of the above, finding the numerical values for the two constants somewhere and declaring the constants yourself if not already declared and see if that works for you.

from docker-images-php.

tdgroot avatar tdgroot commented on May 20, 2024

@davidalger thank you for your findings. Good to know that it's possible to upgrade the cURL library, however I'd like to go for a more thorough solution.

Would it be an option to create image variants based on centos:8, and perhaps, in a later stage based on rocky-linux? I'll do some testing to see if it's as easy as switching the base image and changing the added repos.

from docker-images-php.

davidalger avatar davidalger commented on May 20, 2024

With latest images built with EL 8 base, these curl flags are now available:

$ docker run --rm -it davidalger/php:7.4 php -r 'echo CURLHEADER_SEPARATE . PHP_EOL;'
1
$ docker run --rm -it davidalger/php:7.4 php -r 'echo CURLINFO_SCHEME . PHP_EOL;'
1048625

Curl library version is now 7.61.1 vs 7.29.0 as it was with EL 7 base images:

$ docker run --rm -it davidalger/php:7.4 php --ri curl

curl

cURL support => enabled
cURL Information => 7.61.1
Age => 4
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => No
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => Yes
SSL => Yes
SSPI => No
TLS-SRP => Yes
HTTP2 => Yes
GSSAPI => Yes
KERBEROS5 => Yes
UNIX_SOCKETS => Yes
PSL => No
HTTPS_PROXY => Yes
MULTI_SSL => No
BROTLI => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, pop3, pop3s, rtsp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-redhat-linux-gnu
SSL Version => OpenSSL/1.1.1g
ZLib Version => 1.2.11

Directive => Local Value => Master Value
curl.cainfo => no value => no value

from docker-images-php.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.