Skip to content
Latchkey

Composer: requires ext-X * but It Is Missing from Your System in CI

Composer checks each package's platform requirements against the runner's PHP. When a package requires ext-something that is not loaded, the install aborts with "the requested PHP extension ext-X is missing from your system".

What this error means

Composer install/update fails listing one or more ext-* requirements as missing, e.g. "ext-soap" or "ext-bcmath". The same install succeeds locally where those extensions are enabled.

composer
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - acme/api 2.0.0 requires ext-soap * -> it is missing from your system.
      Install or enable PHP's soap extension.

Common causes

The required extension is not enabled on the runner

A package declares ext-X in its require block. If the runner PHP does not have that extension loaded, Composer refuses to install.

A transitive dependency added a new extension requirement

An upgraded dependency may newly require an extension, so a previously-green install starts failing on the missing ext-*.

How to fix it

Enable the extension in CI

Add the exact extension on setup-php so it is present before install.

php
- uses: shivammathur/setup-php@v2
  with:
    php-version: '8.3'
    extensions: soap, bcmath

Install it in a Docker image

composer
apt-get update && apt-get install -y libxml2-dev
docker-php-ext-install soap bcmath
php -m | grep -E 'soap|bcmath'

Find which package needs it

  1. Read the "Problem" block - it names the package and the ext-* it requires.
  2. Run composer why-not php-soap style checks to trace the requirement.
  3. Enable the extension rather than ignoring the platform requirement.

How to prevent it

  • Mirror production extensions in CI via setup-php so installs match runtime.
  • Run composer check-platform-reqs to catch missing extensions early.
  • Avoid blanket --ignore-platform-reqs; install the real extension instead.

Related guides

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