Reputation: 5082
I'm trying to install Laravel on my computer with Composer. So I did install Composer well.
And now I run the command line:
composer create-project laravel/laravel demo --prefer-dist
But i always have this error:
[Composer\Downloader\TransportException] The "http://packagist.org/p/laravel/laravel$43a87aca57a4c34246b77034dd42057 3201ad96143b5c65bb87611e6d808d872.json" file could not be downloaded: send of 103 bytes failed with errno=10053 Une connexion ?tablie a ?t? abandonn?e par un logiciel de votre ordinateur h?te. send of 21 bytes failed with errno=10053 Une connexion ?tablie a ?t? abando
nn?e par un logiciel de votre ordinateur h?te. send of 114 bytes failed with errno=10053 Une connexion ?tablie a ?t? aband onn?e par un logiciel de votre ordinateur h?te. send of 2 bytes failed with errno=10053 Une connexion ?tablie a ?t? abandon n?e par un logiciel de votre ordinateur h?te. send of 2 bytes failed with errno=10053 Une connexion ?tablie a ?t? abandon n?e par un logiciel de votre ordinateur h?te. failed to open stream: HTTP request failed!install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-p lugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--ver bose] [-o|--optimize-autoloader] [packages1] ... [packagesN]
I googled it, but didn't find an answer. I'm at home and don't have proxy who stop me.
Do you have an idea why I have this problem?
Thanks
Upvotes: 0
Views: 1432
Reputation: 65
You don't need to uninstall the web filter, changing the composer.json file (above) in order to use HTTPS was enough for me.
Upvotes: 0
Reputation: 151
First off, if you're running a web filter, especially K9 Web Protection, uninstall that first and retry. If the problem persists, read ahead:
The problem is that Composer downgrades to http requests after the first https request to the server. This is done to improve performance/speed and to ensure file integrity/security via the sha256 hashes. In any case, this will cause a 10053 error (errno=10053 An established connection was aborted by the software in your host machine ... failed to open stream: HTTP request failed!) on some machines.
The reason this happens to some people and not others seems to be the manner in which your ISP handles http requests. In my case, they're re-routed through a caching proxy; which doesn't work well with the way Composer crafts its http requests. That's what happened with me - others may have a different cause. In any case, the fix is to force Composer to use https requests instead of http requests:
Add the following to your Composer installation's config file (composer.json). In Windows, you may find this file at C:\Users{Your Username}\AppData\Roaming\Composer.
"repositories": [
{
"packagist": false
},
{
"type": "composer",
"url": "https://packagist.org/"
}
],
Then go ahead and create your project again with the same command: composer create-project laravel/laravel demo --prefer-dist. It should work now.
Upvotes: 2