/errors/composer/composer-detected-issues-in-your-platform
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0"
- tool
- Composer
- exit code
- 255
- versions
- Composer 2.x
- os
- any
Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.2.0". You are running 8.1.2. is printed by vendor/composer/platform_check.php, a file Composer generates during composer install and composer update. It runs on every request through vendor/autoload.php and stops the application when the PHP version (or an extension) does not meet what the installed packages need. Run the code with the PHP version shown in the message, or reinstall the dependencies for the PHP you actually run.
How the check works
Composer computes the lowest PHP version allowed by all installed packages and writes it into platform_check.php. At run time the file compares it with PHP_VERSION_ID. On the command line it writes the message to standard error; in every case it then throws a RuntimeException that starts with Composer detected issues in your platform:. For missing extensions the message reads Your Composer dependencies require the following PHP extensions to be installed: ....
Fix
Find what the server lacks before deploying:
php -v # the PHP that runs the code
composer check-platform-reqs # compares composer.lock with this PHP and its extensionsLock dependencies for the production PHP version, even when developing on a newer one:
{
"config": {
"platform": {
"php": "8.1.2"
}
}
}composer update # re-resolves using PHP 8.1.2 as the platformThe web server and the CLI can use different PHP builds. Compare php -v with the version shown by phpinfo() in the browser.