Composer "requires php >=X but your php version does not satisfy"
A package (or your own require block) declares a PHP version constraint, and the PHP interpreter Composer is using falls outside it. Composer will not install a set that cannot run on this interpreter.
What this error means
Composer aborts during solving, noting a package requires a PHP version your runtime does not satisfy. php -v on the runner shows a version outside the package’s supported range.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework[v11.0.0, ...] require php ^8.2 -> your php version
(8.0.30) does not satisfy that requirement.Common causes
The runner PHP is older than the package needs
Modern releases drop old PHP versions. On PHP 8.0 a package requiring ^8.2 is rejected, and Composer cannot resolve the set.
The runner PHP is newer than the package supports
Some packages cap their upper bound. On a brand-new PHP they have no compatible release, so the constraint cannot be met.
How to fix it
Pin the PHP version in CI
Select an interpreter that sits inside every dependency’s supported range.
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
- run: php -vConfirm which PHP Composer is actually using
- Run
php -vandcomposer --versionin the same step. - If
which phppoints at an unexpected binary, your PATH is wrong. - Check
config.platform.phpincomposer.jsonis not pinning an older version than the runtime.
How to prevent it
- Declare a
"php"constraint in your owncomposer.jsonso consumers get a clear error. - Test against the exact PHP versions you support in a CI matrix.
- Keep
config.platform.phpaligned with the PHP you actually deploy on.