0
votes

I wanted to install Guzzle HTTP package for my Laravel 5.3 project.

But when I ran the specific install command, composer shows the following:

[Composer\Downloader\TransportException]
The "http://packagist.org/p/cordoval/hamcrest-php%249e26dffac4ed896eb042373003ee127ad49377842601ba5bd833d00e135a3c62.json" file could not be downloaded: failed to open stream: HTTP request failed!

Tried composer diagnose and checked that all ok. Also tried composer self-update but that's no help, too.

2
can you post your composer diagnose results ?Anar Bayramov
``` Checking composer.json: OK Checking platform settings: OK Checking git settings: OK Checking http connectivity to packagist: OK Checking https connectivity to packagist: OK Checking github.com rate limit: OK Checking disk free space: OK Checking pubkeys: Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642 Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952 OK Checking composer version: OK ```Tishad Touhidul

2 Answers

1
votes

Try to force HTTPS for all resources by running composer config -g repo.packagist composer https://packagist.org

0
votes

Finally, after adding the following code at the end of composer.json, it worked!

"repositories": [ { "type": "composer", "url": "https://packagist.org" }, { "packagist": false } ]