Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to download & install laravel with composer #5656

Closed
quoctrung2610 opened this issue Sep 8, 2016 · 14 comments
Closed

Unable to download & install laravel with composer #5656

quoctrung2610 opened this issue Sep 8, 2016 · 14 comments
Labels

Comments

@quoctrung2610
Copy link

With the following composer.json:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3."
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.
",
"phpunit/phpunit": "~5.0",
"symfony/css-selector": "3.1.",
"symfony/dom-crawler": "3.1.
"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\Foundation\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\Foundation\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}

When I run this command:

php composer.phar install

or:

composer global require "laravel/installer"

I get this output:

C:\wamp\www\st>php composer.phar install
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Loading composer repositories with package information
Updating dependencies (including require-dev)


  [Composer\Downloader\TransportException]
  The "http://packagist.org/p/laravel/framework%24d96abc693256d946d71122810d8151f9d954c7740b9889494f8d6f4136b10893.js
  on" file could not be downloaded: failed to open stream: HTTP request failed!


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

I could not download laravel package.

@alcohol alcohol added the Support label Sep 8, 2016
@Seldaek
Copy link
Member

Seldaek commented Sep 10, 2016

Try to force https for all resources by running composer config -g repo.packagist composer https://packagist.org - that usually helps get around such network issues.

@dameety
Copy link

dameety commented Mar 19, 2017

@Seldaek Thanks. You just help solved my composer/image intervention issue.

@ashish135
Copy link

Hello,

I'm getting this error...

The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out
https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

[Composer\Downloader\TransportException]
The "https://packagist.org/p/intervention/image%243890bd39eb46bef5763ee74a0815873acd5a6a9eea8cdd3521a8a0a28317c7d0.json" file could not be downloaded: failed to open stream: Connection timed o
ut

Using php composer.phar require intervention/image this command.

Help Me!

@victorhugorch
Copy link

Add this lines to your composer.json @ashish135

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

@genyded
Copy link

genyded commented Mar 23, 2018

Why is https not the default?

@donkovah
Copy link

@victorhugorch Your answer was brief, But helped a lot. Thanks

@fsevenm
Copy link

fsevenm commented Apr 6, 2018

The solution from @Seldaek also work. Thanks

@flashadvocate
Copy link

flashadvocate commented Apr 29, 2018

Thanks @Seldaek. Been fighting this for days now and you saved the day

@Benjy1979
Copy link

Worked for me with mpdf install as well. Thanks,

@felipearaujodev
Copy link

@victorhugorch solution worked

@mayur22-pune
Copy link

Hello Frirnds,
I am getting this error while installing laravel by composer by cmd

[Composer\Downloader\TransportException]
Content-Length mismatch, received 1490135 bytes out of the expected 2080224

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--r
epository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no
-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vc
s] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [] [

] []

So anyone can tell the solution

i used following command to install laravel

composer create-project laravel/laravel laravel "5.1.*"

Please Help me...

@rob006
Copy link

rob006 commented Aug 10, 2019

Try to force https for all resources by running composer config -g repo.packagist composer https://packagist.org - that usually helps get around such network issues.

Shouldn't this be https://repo.packagist.org now instead of https://packagist.org? I've seen a lot of people refer to this comment as an official solution blessed by Composer's maintainer. It may be a good idea to update it after switching to repo.packagist.org.

@sjntruong
Copy link

Add this lines to your composer.json @ashish135

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

thank you, it work with my case.

@fabiobagattoli
Copy link

fabiobagattoli commented Jan 18, 2023

Para mim não deu certo, continua com mesmo erro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests