I'm having problems with using Composer. composer diagnose
gives this result:
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: FAIL
[Composer\Downloader\TransportException] curl error 61 while downloading http://repo.packagist.org/packages.json: Unrecognized content encoding type. libcurl understands identity content encodings.
Checking https connectivity to packagist: FAIL
[Composer\Downloader\TransportException] curl error 61 while downloading https://repo.packagist.org/packages.json: Unrecognized content encoding type. libcurl understands identity content encodings.
// ...
Checking composer version: OK
Composer version: 2.1.8
PHP version: 8.0.11
PHP binary path: /usr/bin/php8.0
OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020
cURL version: 7.68.0 libz ssl OpenSSL/1.0.2n
zip: extension present, unzip present, 7-Zip not available
I've tried to find out what the problem is, but I can't find out. Two thinks that looks weird to me:
- There is no version number after
libz
. - OpenSSL 1.1.1f is installed, but curl is using OpenSSL/1.0.2n.
On another server (with almost the same configuration, where composer works fine) I see some other versions are being used:
OpenSSL version: OpenSSL 1.1.1f 31 Mar 2020
cURL version: 7.68.0 libz 1.2.11 ssl OpenSSL/1.1.1f
This are the versions numbers of my server with issues:
$ curl --version
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.0.2n
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HTTPS-proxy IPv6 Largefile NTLM NTLM_WB SSL TLS-SRP UnixSockets
While the other (working) server has other protocols and features as well:
$ curl --version
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
How can I fix this problem with composer not connecting to packagist?
I'm using Ubuntu 20.04.3 LTS.