Composer Install “Failed to open stream”

谁说胖子不能爱 提交于 2019-12-13 03:01:54

问题


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.


回答1:


Disabling my IPV6 fixed the composer installation and use for me, here is a link on how to do that (Works on Windows 10): https://www.youtube.com/watch?v=dK-IUs84V3w




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/45225073/composer-install-failed-to-open-stream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!