PHP Composer - Downloading Repository Times Out on Update/Install
I was having problems getting
composer install to run. It kept hanging on "Loading repositories with package information." I tried to download the package list manually using wget as a test, and it hung as well:
$ wget https://repo.packagist.org/packages.json --2019-01-13 13:04:50-- https://repo.packagist.org/packages.json Resolving repo.packagist.org (repo.packagist.org)... 2607:5300:201:2100::7:2273, 220.127.116.11 Connecting to repo.packagist.org (repo.packagist.org)|2607:5300:201:2100::7:2273|:443...
The issue has to do with the routing for the IPv6 address of repo.packagist.org being broken, as noted in this GitHub issue.
I tried disabling IPv6 in Fedora's Network Manager, but for some reason, I was still getting an IPv6 address on the interface. I solved this problem using a temporary method suggested in the comments of the issue above by manually adding the IPv4 address of repo.packagist.org to the hosts file on my machine:
# dig +short repo.packagist.org 18.104.22.168 # echo "22.214.171.124 repo.packagist.org" >> /etc/hosts