Ffile2fix
Sign in Get started

Fix Composer "Your requirements could not be resolved to an installable set of packages"

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires laravel/framework ^11.0 -> satisfiable by laravel/framework[v11.0.0, ..., v11.x-dev].
    - laravel/framework v11.0.0 requires php ^8.2 -> your php version (8.1.27) does not satisfy that requirement.

Composer could not find any set of package versions that satisfies every constraint at once: your composer.json, each package's own requirements, your PHP version and your installed extensions. The 'Problem 1' lines name the exact conflict, and the fix is to change one of those constraints rather than force the install.

Also appears as: Your lock file does not contain a compatible set of packages. Please run composer update. · - Root composer.json requires vendor/package ^3.0, found vendor/package[1.0.0, 2.4.1] but it does not match the constraint. · - Root composer.json requires PHP extension ext-intl * but it is missing from your system. Install or enable PHP's intl extension. · - vendor/a 2.0.0 requires symfony/console ^7.0 -> found symfony/console[v7.0.0, ...] but these were not loaded, likely because it conflicts with another require.

Common causes

  • The PHP version running Composer is older or newer than a package allows (the CLI version can differ from the web server's)
  • A required PHP extension such as ext-intl, ext-gd or ext-zip is not installed or enabled for the CLI
  • Two packages require incompatible versions of the same dependency
  • composer.json asks for a version that does not exist or is not stable enough for minimum-stability
  • composer.lock was created on a different PHP version, so composer install cannot use it
  • A private repository or path package is unreachable, so its versions are not found

How to fix it

  1. Read Problem 1 from the bottom up. The last line of each problem states the real blocker, such as 'your php version (8.1.27) does not satisfy that requirement' or 'it is missing from your system'. Fix that line first; later problems often disappear.
  2. Check the PHP Composer actually uses. Run php -v and composer diagnose. Servers often have several PHP versions, so call the right one explicitly, such as php8.3 /usr/local/bin/composer install.
  3. Install missing extensions. Run composer check-platform-reqs to list missing extensions, then install them, for example sudo apt install php8.3-intl. Confirm with php -m that the CLI loads them.
  4. Ask Composer why a version is blocked. Run composer why-not vendor/package 3.0 to see which package or constraint prevents it. This tells you which requirement to relax or upgrade.
  5. Update the conflicting packages together. Run composer update vendor/package --with-all-dependencies (-W) so Composer can also move the packages that depend on it, instead of only one package.
  6. Pin the platform for deployment. If you build on a different PHP than production, set config.platform.php to the production version so the lock file matches the server. Use --ignore-platform-req=ext-x only when you know the extension is present at runtime.

Terminal + composer.json

composer check-platform-reqs
composer why-not laravel/framework 11.0
composer update laravel/framework -W

// composer.json - match production PHP
"config": {
    "platform": { "php": "8.2.20" }
}

How to stop it happening again

  • Use the same PHP version and extensions locally, in CI and in production
  • Commit composer.lock and run composer install, not update, on servers
  • Set config.platform.php to your production PHP version
  • Upgrade frameworks and their plugins together, following each upgrade guide

Frequently asked questions

Should I use --ignore-platform-reqs?

Only as a last resort. It installs packages that may not run on your PHP or without the missing extension, so the error moves to runtime. Prefer fixing PHP or adding the specific extension.

Why does it work locally but fail on the server?

The server's CLI PHP version or extension list differs from yours. Compare php -v and php -m on both, or set config.platform so the lock file targets the server.

What does 'these were not loaded, likely because it conflicts with another require' mean?

Composer found matching versions but excluded them because another package or your root constraint rules them out. Use composer why-not on that version to find the blocking requirement.