Composer "requires php >=8.x -> your php version does not satisfy that requirement" in CI
A package (directly or transitively) requires a newer PHP than the runner provides. Composer reports the required constraint and the runner PHP it detected, then refuses to install.
What this error means
composer install fails with a Problem block: "requires php >=8.2 -> your php version (8.1.x) does not satisfy that requirement".
Composer
Problem 1
- symfony/console v7.0.0 requires php >=8.2 -> your php version (8.1.27)
does not satisfy that requirement.Common causes
The CI runner PHP is older than the dependency needs
The default or pinned PHP on the runner predates the version a package requires, so Composer excludes that package.
A transitive dependency bumped its minimum PHP
An upgrade pulled in a release that raised its php requirement above the runner interpreter.
How to fix it
Pin the runner PHP with setup-php
- Read the "requires php >=X" line to see the minimum needed.
- Set that PHP version with shivammathur/setup-php before composer runs.
- Re-run so the interpreter satisfies the constraint.
.github/workflows/ci.yml
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'Or hold the dependency at a PHP-compatible version
If you must stay on the older PHP, pin the package to the last release that still supports it.
Terminal
composer require symfony/console:^6.4How to prevent it
- Pin the runner PHP explicitly with setup-php, not the image default.
- Match your
composer.json"php" constraint to the runner version. - Review PHP requirement bumps when upgrading major dependencies.
Related guides
Composer --ignore-platform-reqs: when it helps and when it hides bugs in CIUnderstand Composer --ignore-platform-reqs in CI - it skips PHP version and ext-* checks so install proceeds,…
Composer "Your requirements could not be resolved to an installable set of packages" in CIFix Composer "Your requirements could not be resolved to an installable set of packages" in CI - the solver f…
Composer "Root package requires X but it does not match" in CIFix Composer "Root composer.json requires vendor/pkg X but it does not match the constraint" in CI - your roo…