Closed tdgroot closed 3 years ago
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
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.
@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.
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
First of all: thank you for all your great work on Warden! I love the solution you've built :).
I'm running into some problems caused by missing cURL constants:
(shell created from
docker run -it davidalger/php:7.4 /bin/bash
)CURLHEADER_SEPARATE
was introduced in cURL version 7.37.0.CURLINFO_SCHEME
was introduced in cURL version 7.52.0.CentOS 7.9 has cURL version 7.29.0 (dated from 2013).
I'm not sure if I'm in a very rare use case, but do you see any possibilities?
Willing to collaborate!