What you see
curl error 28 while downloading https://repo.packagist.org/packages.json: Operation timed out after 10002 milliseconds with 0 out of 0 bytes receivedCommon causes
- Slow routes to repo.packagist.org or GitHub.
- GitHub rate limits on unauthenticated archive downloads, which can look like hangs.
- IPv6 routes that do not work.
How to fix it
- 01
Raise the timeout
Composer reads a process timeout and a separate HTTP timeout.
shell export COMPOSER_PROCESS_TIMEOUT=600 composer config --global http-timeout 120 - 02
Add a GitHub token
Authenticated requests get much higher limits.
shell composer config --global github-oauth.github.com "$GITHUB_TOKEN" - 03
Fetch from a regional cache
Metadata and archives come from the cache after the first pull.
composer.json "repositories": [ { "type": "composer", "url": "https://acme.cacheport.cc/composer/" }, { "packagist.org": false } ]