Skip to content
Latchkey

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

  1. Read the "requires php >=X" line to see the minimum needed.
  2. Set that PHP version with shivammathur/setup-php before composer runs.
  3. 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.4

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →