0

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

5
  • Maybe the remote service is having problems? Commented Aug 15, 2014 at 10:19
  • The error message definitely points to an issue downloading the Laravel package info from Packagist. Though you should try updating your composer installation just in case it's out of date and using old URLs or something - composer self-update. Commented Aug 15, 2014 at 10:24
  • I copied your composer command exactly and it worked for me. Try a self update like alexrussell says and see if that fixes it. Commented Aug 15, 2014 at 11:03
  • 1
    There's now an easier way to install Laravel. Try running... composer global require "laravel/installer=~1.1" - And then us laravel new demo Commented Aug 15, 2014 at 11:10
  • I tried to update composer. Here the message: You are already using composer version 1e27ff5e22df81e3cd0cd36e5fdd4a3c5a031f4a. Apparently I already have the last version of composer. I also tried running composer global require, but still have the same error message. I don't know what to do? Commented Aug 16, 2014 at 6:32

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Smart! BTW How did you understand what's happening in the ISP?
0

You don't need to uninstall the web filter, changing the composer.json file (above) in order to use HTTPS was enough for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.