Tuesday, May 7, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 3496  / 1 Year ago, sun, february 26, 2023, 8:17:40

I was facing some issue today when trying to install composer with the below command:



curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer


It was giving me this error:



curl: (7) Failed to connect to getcomposer.org port 443: Network is unreachable


I googled and found this command:



echo ipv4 >> ~/.curlrc


I ran this and it fixed the problem and composer installed just fine.



But I don't know what the above command does, could anyone explain it?


More From » command-line

 Answers
0

What is does is add "ipv4" to the file "curlrc". Example starting with an empty file:



$ touch 1
$ more 1
$ echo ipv4 >> 1
$ more 1
ipv4


Basically it forces curl to use ipv4.






The manual has this to say about it:




IPv6



curl will connect to a server with IPv6 when a host lookup returns an IPv6 address and fall back to IPv4 if the connection fails. The --ipv4 and --ipv6 options can specify which address to use when both are available. IPv6 addresses can also be specified directly in URLs using the syntax



[#11164] Monday, February 27, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
egantfis

Total Points: 406
Total Questions: 108
Total Answers: 108

Location: Austria
Member since Thu, Jan 7, 2021
3 Years ago
;