Installing aws-sdk-php in local machine -- http request failed

2.8k views Asked by At

I am trying to install aws-sdk-php in my local machine using this reference url

When I try -- php composer.phar require aws/aws-sdk-php

It gives me the following error:

[Composer\Downloader\TransportException] The "http://packagist.org/p/aws/aws-sdk-php%24a8b264f89dd462e84ffdc6487d616b6126bbc20d00351e8a9daf81c5d66f2305.json" file could not be downloaded: failed to open stream: HTTP request failed!

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] []...

Any help/hint is highly appreciated. Thanks in advance.

1

There are 1 answers

2
popeye On BEST ANSWER
php -r "file_get_contents('http://packagist.org/p/aws/aws-sdk-php%24a8b264f89dd462e84ffdc6487d616b6126bbc20d00351e8a9daf81c5d66f2305.json');" 

try this way

OR

hit this: composer config -g repo.packagist composer https://packagist.org

and try YOUR way again