Composer cannot download files

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

Leave a Comment