Composer HTTP Request Failed
I ran the update
command on Composer and received the following error:
[Composer\Downloader\TransportException]
The "http://packagist.org/p/symfony/class-loader$78539d95ddac0cc02514ed9cdf1515023dcd289b4f7e03ed948e868a1b02acf2.json" file could not be downloaded: failed to open stream: HTTP request failed!
Seems odd considering I was able to install Composer using php cli
. I believe my Apache configuration, which forces all traffic over https, is to blame. I found the following solution in the GitHub forums.
Modify your composer.json
file to include the following:
"repositories": [ { "packagist": false }, { "type": "composer", "url": "https://packagist.org/" } ],
Then run the update
command. This tells Composer the repository is at https://packagist.org
, instead of the default http variation.
Credit: https://github.com/composer/composer/issues/1992 (specifically https://github.com/cs278)