Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cURL version #5

Closed
tdgroot opened this issue Mar 15, 2021 · 3 comments
Closed

cURL version #5

tdgroot opened this issue Mar 15, 2021 · 3 comments

Comments

@tdgroot
Copy link
Contributor

tdgroot commented Mar 15, 2021

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:

image
(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?

  • I looked up the SCL repo, but that doesn't seem to contain a cURL upgrade).
  • Downloading a newer release will probably not work, because I believe that many programs are linked with the default cURL libs).

Willing to collaborate!

@davidalger
Copy link
Owner

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.

@tdgroot
Copy link
Contributor Author

tdgroot commented Mar 17, 2021

@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.

@davidalger
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants