composer: Failed to download from dist: curl error 28 while downloading Failed to connect to codeload.github.com port 443 after 10011 ms: Timeout was reached

My composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The skeleton application for the Laravel framework.",
    "keywords": ["laravel", "framework"],
    "license": "MIT",
    "require": {
        "php": "^8.2",
        "laravel/framework": "^11.9",
        "laravel/tinker": "^2.9"
    },
    "require-dev": {
        "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.26",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.0",
        "phpunit/phpunit": "^11.0.1"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi",
            "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
            "@php artisan migrate --graceful --ansi"
        ]
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true,
        "allow-plugins": {
            "pestphp/pest-plugin": true,
            "php-http/discovery": true
        }
    },
    "minimum-stability": "stable",
    "prefer-stable": true
}

Output of composer diagnose:

Checking composer.json: OK
Checking platform settings: The COMPOSER_IPRESOLVE env var is set to 4 which may result in network failures below.
Checking git settings: OK git version 2.43.0
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK expires on 2024-08-22 19:40:11 UTC
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
Checking Composer and its dependencies for vulnerabilities: OK
Composer version: 2.7.7
PHP version: 8.2.12
PHP binary path: C:\xampp\php\php.exe
OpenSSL version: OpenSSL 3.0.11 19 Sep 2023       
curl version: 8.4.0 libz 1.2.12 ssl OpenSSL/3.0.11
zip: extension present, unzip present, 7-Zip present (7z)

When I run this command:

 composer require "package/name" or  new laravel project or composer update  commands

I get the following output:

Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Package operations: 107 installs, 0 updates, 0 removals       
  - Downloading doctrine/inflector (2.0.10)
  - Downloading doctrine/lexer (3.0.1)
  - Downloading symfony/polyfill-ctype (v1.30.0)
  - Downloading webmozart/assert (1.11.0)
  - Downloading dragonmantank/cron-expression (v3.3.3)
  - Downloading symfony/deprecation-contracts (v3.5.0)
  - Downloading psr/container (2.0.2)
  - Downloading fakerphp/faker (v1.23.1)
  - Downloading symfony/polyfill-php83 (v1.30.0)
  - Downloading symfony/polyfill-mbstring (v1.30.0)
  - Downloading symfony/http-foundation (v7.1.1)
  - Downloading fruitcake/php-cors (v1.3.0)
  - Downloading psr/http-message (2.0)
  - Downloading psr/http-client (1.0.3)
  - Downloading ralouphie/getallheaders (3.0.3)
  - Downloading psr/http-factory (1.1.0)
  - Downloading guzzlehttp/psr7 (2.7.0)
  - Downloading guzzlehttp/promises (2.0.3)
  - Downloading guzzlehttp/guzzle (7.9.1)
  - Downloading symfony/polyfill-php80 (v1.30.0)
  - Downloading guzzlehttp/uri-template (v1.0.3)
  - Downloading laravel/pint (v1.17.0)
  - Downloading symfony/polyfill-intl-normalizer (v1.30.0)
  - Downloading symfony/polyfill-intl-grapheme (v1.30.0)
  - Downloading symfony/string (v7.1.2)
  - Downloading symfony/service-contracts (v3.5.0)
  - Downloading symfony/console (v7.1.2)
  - Downloading voku/portable-ascii (2.0.1)
  - Downloading phpoption/phpoption (1.9.3)
  - Downloading graham-campbell/result-type (v1.1.3)
  - Downloading vlucas/phpdotenv (v5.6.1)
  - Downloading symfony/css-selector (v7.1.1)
  - Downloading tijsverkoyen/css-to-inline-styles (v2.2.7)
  - Downloading symfony/var-dumper (v7.1.2)
  - Downloading symfony/polyfill-uuid (v1.30.0)
  - Downloading symfony/uid (v7.1.1)
  - Downloading symfony/routing (v7.1.1)
  - Downloading symfony/process (v7.1.1)
  - Downloading symfony/polyfill-php72 (v1.30.0)
  - Downloading symfony/polyfill-intl-idn (v1.30.0)
  - Downloading symfony/mime (v7.1.2)
  - Downloading psr/event-dispatcher (1.0.0)
  - Downloading symfony/event-dispatcher-contracts (v3.5.0)
  - Downloading symfony/event-dispatcher (v7.1.1)
  - Downloading psr/log (3.0.0)
  - Downloading egulias/email-validator (4.0.2)
  - Downloading symfony/mailer (v7.1.2)
  - Downloading symfony/error-handler (v7.1.2)
  - Downloading symfony/http-kernel (v7.1.2)
  - Downloading symfony/finder (v7.1.1)
  - Downloading ramsey/collection (2.0.0)
  - Downloading brick/math (0.12.1)
  - Downloading ramsey/uuid (4.7.6)
  - Downloading psr/simple-cache (3.0.0)
  - Downloading nunomaduro/termwind (v2.0.1)
  - Downloading symfony/translation-contracts (v3.5.0)
  - Downloading symfony/translation (v7.1.1)
  - Downloading psr/clock (1.0.0)
  - Downloading symfony/clock (v7.1.1)
  - Downloading carbonphp/carbon-doctrine-types (3.2.0)
  - Downloading nesbot/carbon (3.7.0)
  - Downloading monolog/monolog (3.7.0)
  - Downloading league/mime-type-detection (1.15.0)
  - Downloading league/flysystem (3.28.0)
  - Downloading league/flysystem-local (3.28.0)
  - Downloading nette/utils (v4.0.4)
  - Downloading nette/schema (v1.3.0)
  - Downloading dflydev/dot-access-data (v3.0.3)
  - Downloading league/config (v1.2.0)
  - Downloading league/commonmark (2.5.0)
  - Downloading laravel/serializable-closure (v1.3.3)
  - Downloading laravel/prompts (v0.1.24)
  - Downloading laravel/framework (v11.17.0)
  - Downloading symfony/yaml (v7.1.1)
  - Downloading laravel/sail (v1.31.0)
  - Downloading nikic/php-parser (v5.1.0)
  - Downloading psy/psysh (v0.12.4)
  - Downloading laravel/tinker (v2.9.0)
  - Downloading hamcrest/hamcrest-php (v2.0.1)
  - Downloading mockery/mockery (1.6.12)
  - Downloading filp/whoops (2.15.4)
  - Downloading nunomaduro/collision (v8.3.0)
  - Downloading sebastian/version (5.0.1)
  - Downloading sebastian/type (5.0.1)
  - Downloading sebastian/recursion-context (6.0.2)
  - Downloading sebastian/object-reflector (4.0.1)
  - Downloading sebastian/object-enumerator (6.0.1)
  - Downloading sebastian/global-state (7.0.2)
  - Downloading sebastian/exporter (6.1.3)
  - Downloading sebastian/environment (7.2.0)
  - Downloading sebastian/diff (6.0.2)
  - Downloading sebastian/comparator (6.0.1)
  - Downloading sebastian/code-unit (3.0.1)
  - Downloading sebastian/cli-parser (3.0.2)
  - Downloading phpunit/php-timer (7.0.1)
  - Downloading phpunit/php-text-template (4.0.1)
  - Downloading phpunit/php-invoker (5.0.1)
  - Downloading phpunit/php-file-iterator (5.0.1)
  - Downloading theseer/tokenizer (1.2.3)
  - Downloading sebastian/lines-of-code (3.0.1)
  - Downloading sebastian/complexity (4.0.1)
  - Downloading sebastian/code-unit-reverse-lookup (4.0.1)
  - Downloading phpunit/php-code-coverage (11.0.5)
  - Downloading phar-io/version (3.2.1)
  - Downloading phar-io/manifest (2.0.4)
  - Downloading myclabs/deep-copy (1.12.0)
  - Downloading phpunit/phpunit (11.2.8)
   0/107 [>---------------------------]   0%    Failed to download doctrine/inflector from dist: curl error 28 while downloading https://codeload.github.com/doctrine/inflector/legacy.zip/5817d0659c5b50c9b950feb9af7b9668e2c436bc: Failed to connect to codeload.github.com port 443 after 10011 ms: Timeout was reached
    Now trying to download from source
  - Syncing doctrine/inflector (2.0.10) into cache
   1/107 [>---------------------------]   0%    Failed to download doctrine/lexer from dist: curl error 28 while downloading https://codeload.github.com/doctrine/lexer/legacy.zip/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd: Failed to connect to codeload.github.com port 443 after 23962 ms: Couldn't connect to server
    Now trying to download from source
  - Syncing doctrine/lexer (3.0.1) into cache
    Failed to download dragonmantank/cron-expression from dist: curl error 28 while downloading https://codeload.github.com/dragonmantank/cron-expression/legacy.zip/adfb1f505deb6384dc8b39804c5065dd3c8c8c0a: Failed to connect to codeload.github.com port 443 after 23897 ms: Couldn't connect to server
    Now trying to download from source
  - Syncing dragonmantank/cron-expression (v3.3.3) into cache
    Failed to download symfony/deprecation-contracts from dist: curl error 28 while downloading https://codeload.github.com/symfony/deprecation-contracts/legacy.zip/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1: Failed to connect to codeload.github.com port 443 after 23896 ms: Couldn't connect to server
    Now trying to download from source
  - Syncing symfony/deprecation-contracts (v3.5.0) into cache
    Failed to download psr/container from dist: curl error 28 while downloading https://codeload.github.com/php-fig/container/legacy.zip/c71ecc56dfe541dbd90c5360474fbc405f8d5963: Failed to connect to codeload.github.com port 443 after 23895 ms: Couldn't connect to server
    Now trying to download from source
  - Syncing psr/container (2.0.2) into cache
    Failed to download fakerphp/faker from dist: curl error 28 while downloading https://codeload.github.com/FakerPHP/Faker/legacy.zip/bfb4fe148adbf78eff521199619b93a52ae3554b: Failed to connect to codeload.github.com port 443 after 23895 ms: Couldn't connect to server
    Now trying to download from source
  - Syncing fakerphp/faker (v1.23.1) into cache
    Failed to download symfony/polyfill-php83 from dist: curl error 28 while downloading https://codeload.github.com/symfony/polyfill-php83/legacy.zip/dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9: Failed to connect to codeload.github.com port 443 after 23894 ms: Couldn't connect to server
    Now trying to download from source
  - Syncing symfony/polyfill-php83 (v1.30.0) into cache
    Failed to download symfony/polyfill-mbstring from dist: curl error 28 while downloading https://codeload.github.com/symfony/polyfill-mbstring/legacy.zip/fd22ab50000ef01661e2a31d850ebaa297f8e03c: Failed to connect to codeload.github.com port 443 after 23890 ms: Couldn't connect to server
    Now trying to download from source
  - Syncing symfony/polyfill-mbstring (v1.30.0) into cache
    Failed to download symfony/http-foundation from dist: curl error 28 while downloading https://codeload.github.com/symfony/http-foundation/legacy.zip/74d171d5b6a1d9e4bfee09a41937c17a7536acfa: Failed to connect to codeload.github.com port 443 after 14179 ms: Timeout was reached
    Now trying to download from source
  - Syncing symfony/http-foundation (v7.1.1) into cache

I use composer for months without any errors but now I don’t know what’s happened. please help me.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 28 (2 by maintainers)

Most upvoted comments

problem +

This is all network problems with codeload.github.com which is unfortunately not infrastructure we control so I cannot do much here. I’d reach out to github support if you are experiencing issues for longer than a few hours.

same here

I couldn’t solve this problem, so I had to format my laptop.🙃