Magento 2: Composer Update is Not Working [Failed to open stream: Connection timed out]
-
05-10-2020 - |
Вопрос
I'm trying to update composer but it gives below error.
root@magento-2:/var/www/html/magento# composer clear-cache
root@magento-2:/var/www/html/magento# composer diagnose
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Checking composer.json: WARNING
The version field is present, it is recommended to leave it out if the package is published on Packagist.
Defining autoload.psr-0 with an empty namespace prefix is a bad idea for performance
require.magento/product-community-edition : exact version constraints (2.1.3) should be avoided if the package follows semantic versioning
require.composer/composer : unbound version constraints (@alpha) should be avoided
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: WARNING
[Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
OK
Checking composer version: OK
I also visited https://getcomposer.org/doc/articles/troubleshooting.md & SO
Решение
The issue has been reported here: https://github.com/composer/composer/issues/4247
In addition to that, following will solve the issue:
sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"
Не связан с magento.stackexchange