12

I am trying to install a new laravel instance with the following command:

composer create-project laravel/larevel authii --prefer-dist

But I am encountering the following problem: enter image description here

My internet connection is on proxy server: 192.168.20.9:8080 Moreover, I am on windows platform win8.1 x64 and Xampp with PHP 5.6.11, any help?

Saani
  • 791
  • 7
  • 28
  • 68

6 Answers6

15

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

rob006
  • 21,383
  • 5
  • 53
  • 74
6

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
Community
  • 1
  • 1
André Schild
  • 4,592
  • 5
  • 28
  • 42
  • 1
    Why is this happening? I have this error now, nothing changed in my envirnoment, AT ALL. – nclsvh Feb 04 '17 at 23:50
  • Just an extra. On [Composer's troubleshooting page](https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode) it says something about ipv6 compatibility issues. Just disable ipv6, run composer and enable it again. – Marcos Rocha Apr 01 '19 at 14:22
5

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.

TheTC
  • 677
  • 9
  • 19
2

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.

Herr Nentu'
  • 1,438
  • 3
  • 18
  • 49
0

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)
Parth kharecha
  • 6,135
  • 4
  • 25
  • 41
0

For me, on my Windows machine, I was installing phpmailer; So, I mistakenly wrote

composer require phpmailer\phpmailer 

instead of

composer require phpmailer/phpmailer

I just thought somebody may have made that same silly mistake I made. So please use forward slash instead of backslash.

Stephen Adelakun
  • 784
  • 2
  • 7
  • 24