/errors/composer/requirements-could-not-be-resolved
Composer: Your requirements could not be resolved to an installable set of packages.
- tool
- Composer
- exit code
- 2
- versions
- Composer 2.x
- os
- any
Your requirements could not be resolved to an installable set of packages. means Composer's solver found no combination of package versions that satisfies every constraint in composer.json (and in the lock file, for composer install). The real reason is in the Problem 1, Problem 2 blocks that follow. Most often it is the PHP version or a missing extension (Root composer.json requires php ^8.2 but your php version (8.1.x) does not satisfy that requirement), or two packages wanting different versions of the same library.
Read the problem lines
Each problem is a short chain: the root requirement, then the package versions Composer tried and why each was rejected. Look for these patterns:
| Line contains | Meaning | Fix |
|---|---|---|
| requires php ^8.2 but your php version (8.1.x) does not satisfy that requirement | Wrong PHP for this lock or package | Use the right PHP, or set config.platform.php |
| requires ext-intl * -> it is missing from your system | A PHP extension is not enabled | Install or enable the extension for the PHP CLI |
| found vendor/pkg[1.0.0, ..., 1.4.2] but it does not match the constraint | No release matches the constraint | Change the constraint |
| but these were not loaded, likely because it conflicts with another require | Two requirements conflict | Use why-not, then -W or adjust constraints |
| could not be found in any version | Typo, private package, or minimum-stability | Check the name, repositories and stability |
Diagnose and fix
composer why-not laravel/framework 11.0 # what blocks this version?
composer why symfony/console # who requires this package?
composer require vendor/package:^3.0 -W # allow its dependencies to change too
composer update -W # update everything that needs to move
composer check-platform-reqs # PHP and extensions the lock file needsMatch production PHP
If developers run a newer PHP than production, pin the platform so Composer resolves for the production version:
{
"config": {
"platform": {
"php": "8.2.0"
}
}
}