3

Whenever I run the installer, or even manually installing Composer, I get an error that disallowed me to complete the installation and it is irritating. In Laragon, a program used to create many different projects using composer and its packages. It will not allow me to use Laravel because the Composer will not properly install and function.

The Error is:

The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

The "https://getcomposer.org/download/1.4.2/composer.phar.sig" file could not be downloaded: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

H45H
  • 1,019
  • 10
  • 28
danteg
  • 41
  • 1
  • 1
  • 6
  • could you add output of "composer diagnose"? update: sorry I didnt noticed that you cant Install it – R A Jul 20 '17 at 21:35
  • are you using linux or windows? – R A Jul 20 '17 at 21:37
  • @RafailAkhmetshin I am using windows, the strange thing is I can use composer diagnose but composer isn't installing... I guess because I am Using Laragon which comes with composer – danteg Jul 20 '17 at 21:45
  • And does composer diagnose give you any warning about failed tests? could you check that url is accessible from php using hints from this answers https://stackoverflow.com/questions/5764002/how-to-php-server-side-check-if-a-url-of-a-web-site-is-valid https://stackoverflow.com/questions/8030789/pinging-an-ip-address-using-php-and-echoing-the-result – R A Jul 20 '17 at 21:49
  • @RafailAkhmetshin It says the websites are dead. Also, I have the diagnose composer errors but I am not sure where to post it. I'm new to stackoverflow. – danteg Jul 20 '17 at 22:38
  • @RafailAkhmetshin Nevermind, here you go: https://pastebin.com/NGk0YxKK – danteg Jul 20 '17 at 22:44
  • are you trying to do this in corporate network or at home? Could you try to connect to https url (important) using curl or something like it ```curl https://getcomposer.org/versions``` Also can you check that your openssl extension is enabled? in php.ini – R A Jul 21 '17 at 13:05
  • So, after a lot of time being frustrated (home network), I tried a VPN and it worked, so how can I do this without a VPN? @RafailAkhmetshin – danteg Jul 24 '17 at 23:06
  • I don't know. We need figure out what was blocked when you use home network. could you open ```https://getcomposer.org/versions``` using your browser or do you receive any king warnings about certificate? – R A Jul 25 '17 at 09:29
  • No warning, it shows this: { "stable": [{"path": "/download/1.4.2/composer.phar", "version": "1.4.2", "min-php": 50300}], "preview": [{"path": "/download/1.4.2/composer.phar", "version": "1.4.2", "min-php": 50300}], "snapshot": [{"path": "/composer.phar", "version": "189ba423aedc387a0487df40afc2428947406327", "min-php": 50300}] } @RafailAkhmetshin – danteg Jul 25 '17 at 16:07
  • Also, the curl getcomposer.org line works and produces the proper line. Although, curl -sS https://getcomposer.org/installer | php resulted in an error while downloading... The "https://getcomposer.org/versions" file could not be downloaded: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. – danteg Jul 25 '17 at 17:02
  • So, I just tried install and use composer on my laptop and it worked, so it is something to do with my PC, that is weird, anything I should do to fix this? @RafailAkhmetshin – danteg Jul 25 '17 at 20:18
  • could you add output of this command ```php -i | grep " PHP Stream"```. also please check to this issue - looks very similar to yours https://github.com/composer/composer/issues/4888 – R A Jul 26 '17 at 07:43
  • 'grep' is not recognized as an internal or external command, operable program or batch file. I tried to clean my ipv6 but it didn't fix. @RafailAkhmetshin – danteg Jul 26 '17 at 16:59

2 Answers2

4

Understand that the error is an IPV6 network error

  • At first, I updated the version of my composer running this command

    composer -vvv self-update

  • I also followed this instruction from composer doc on resolving IPV6 timed out issue

https://getcomposer.org/doc/articles/troubleshooting.md#operation-timed-out-ipv6-issues-

I can't say which of these did the magic

0

Deleting the https_proxy and http_proxy environment vars worked for me (Windows 10). And then installing it, set proxy in blank. It should work as it did for me.

DavidQuezada7
  • 149
  • 2
  • 7