Composer cannot download files

后端 未结 3 1374
梦谈多话
梦谈多话 2020-11-29 08:39

I am trying to use composer on command line :

php composer.phar update
php composer.phar install
php composer.phar self-update
php composer.phar selfupdate
<         


        
相关标签:
3条回答
  • 2020-11-29 08:59

    The right an easy way to run composer on windows under a proxy is opening the console (cmd), go to your project location and run this command:

    C:\wamp\htdocs\myproject\> SET HTTP_PROXY=http://username:password@proxy.yourdomain.com:8080 && php composer.phar install
    

    PD: You must changes parameters like: username, password, proxy.yourdomain.com and 8080 to yours

    I hope this help to you

    0 讨论(0)
  • 2020-11-29 09:00

    And DO NOT set https_proxy (just http_proxy)!

    0 讨论(0)
  • 2020-11-29 09:22

    If you are using composer from behind an HTTP proxy, you can use the standard http_proxy or HTTP_PROXY env vars. Simply set it to the URL of your proxy. Many operating systems already set this variable for you.

    eg:

     HTTP_PROXY="http://my-corp-proxy.mcdonalds" php composer.phar install
    

    bonus points if you throw it into your bashrc if your on Linux/OS X or your environment settings for Windows.

    To make it easier, you can just export the variable, then you don't have to type it all the time.

     export HTTP_PROXY="http://my-corp-proxy.mcdonalds"
     php composer.phar install
    
    0 讨论(0)
提交回复
热议问题