Skip to content
Latchkey

Composer "the requested PHP extension X is missing" in CI

Packages declare platform requirements like ext-intl or ext-gd. Composer checks the running PHP for those extensions and refuses to install a set that needs one the system does not provide, naming the missing extension so you can enable it.

What this error means

composer install fails with "Root composer.json requires PHP extension ext-intl * but it is missing from your system" (or names a dependency requiring it). Enabling the extension in CI resolves it.

composer
Problem 1
  - Root composer.json requires PHP extension ext-intl * but it is
    missing from your system. Install or enable PHP's intl extension.

Common causes

The extension is not installed/enabled in the CI PHP build

The runner’s PHP lacks the extension a package requires, so the platform check fails.

A new dependency added a fresh extension requirement

An updated or added package now requires an extension the CI image never enabled.

How to fix it

Enable the extension in CI

Add the named extension to the PHP setup step so the platform check passes.

.github/workflows/ci.yml
- uses: shivammathur/setup-php@v2
  with:
    php-version: '8.3'
    extensions: intl, gd, mbstring
- run: composer install --no-interaction

Install it directly if not using setup-php

Install and enable the extension package on the runner.

Terminal
# Debian/Ubuntu
sudo apt-get update
sudo apt-get install -y php8.3-intl
composer install --no-interaction

How to prevent it

  • List every required extension in the CI PHP setup so installs do not fail on a missing one.
  • Keep the CI PHP extension set in sync with what your packages and code require.
  • Avoid blanket --ignore-platform-reqs, which only hides a real missing extension.

Related guides

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