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
- 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.
- 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.
- 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.
- 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.
- 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.
- 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