PHP Composer behind http proxy

后端 未结 10 2076
日久生厌
日久生厌 2020-11-29 05:45

I use composer on a network where the only way to access the internet is using HTTP or socks proxy. I have http_proxy and https_proxy environment variables. When compose tri

相关标签:
10条回答
  • 2020-11-29 06:27

    on Windows insert:

    set http_proxy=<proxy>
    set https_proxy=<proxy>
    

    before

    php "%~dp0composer.phar" %*
    

    or on Linux insert:

    export http_proxy=<proxy>
    export https_proxy=<proxy>
    

    before

    php "${dir}/composer.phar" "$@"
    
    0 讨论(0)
  • 2020-11-29 06:30

    Try this:

    export HTTPS_PROXY_REQUEST_FULLURI=false
    

    solved this issue for me working behind a proxy at a company few weeks ago.

    0 讨论(0)
  • 2020-11-29 06:30

    This works , this is my case ...

    C:\xampp\htdocs\your_dir>SET HTTP_PROXY="http://192.168.1.103:8080" 
    

    Replace with your IP and Port

    0 讨论(0)
  • 2020-11-29 06:32

    iconoclast's answer did not work for me.

    I upgraded my php from 5.3.* (xampp 1.7.4) to 5.5.* (xampp 1.8.3) and the problem was solved.

    Try iconoclast's answer first, if it doesn't work then upgrading might solve the problem.

    0 讨论(0)
提交回复
热议问题