I am trying to install a new laravel instance with the following command:
composer create-project laravel/larevel authii --prefer-dist
But
I noticed that this also happens when changing the networks. If I put the comüputer to sleep and then continue connected to other networks this happens. So either restart the computer or your docker. Seems to work for me. Had the issue 2 times already.
Linux users can run this command to resolve this issue:
sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"
More Information
You need to tell composer to use a proxy.
Linke here: PHP Composer behind http proxy and Composer cannot download files
Like:
export HTTP_PROXY="http://my-corp-proxy.mcdonalds"
php composer.phar install
For windows user open cmd and put this command
set http_proxy= xxx.xxx.xxx.xxx:xxxx (YOUR_IP:PORT)
set https_proxy= xxx.xxx.xxx.xxx:xxxx (YOUR_IP:PORT)
The fix for me was found here: https://getcomposer.org/doc/articles/troubleshooting.md#operation-timed-out-ipv6-issues-.
I had to disable IPv6 on my network interfaces. After disabling that, composer worked fine.