Skip to content
Latchkey

Composer "--ignore-platform-req" Masks a Real Runtime Gap in CI

--ignore-platform-req (or --ignore-platform-reqs) tells Composer to install a set even though the current PHP/extension does not satisfy a constraint. It suppresses the check only - the missing capability is still missing, so the code breaks the moment it runs.

What this error means

Install succeeds in CI because someone added --ignore-platform-reqs, then the app fails later with "Call to undefined function" or a fatal that the platform check was warning about. Removing the override turns the install back into a clear, early failure.

CI log
$ composer install --ignore-platform-reqs   # install "passes"
...
$ php bin/run.php
PHP Fatal error:  Uncaught Error: Call to undefined function bcadd() in
/app/src/Money.php:8   # ext-bcmath was never actually present

Common causes

A blanket override hides every platform mismatch

Bare --ignore-platform-reqs ignores all PHP/extension constraints at once. A genuinely missing extension or wrong PHP version slips through install and surfaces at runtime instead.

The build host and runtime host differ

Overriding is sometimes legitimate when building on a host that lacks an extension the runtime has. If the runtime also lacks it, the override just defers the failure.

How to fix it

Scope the override to one named requirement

Ignore a single, deliberately-handled requirement instead of all of them, so other mismatches still fail loudly.

Terminal
composer install --no-interaction --ignore-platform-req=ext-bcmath
# NOT a blanket: --ignore-platform-reqs

Actually provide the capability where code runs

Install the extension / correct PHP on the runtime host, then drop the override.

.github/workflows/ci.yml
- uses: shivammathur/setup-php@v2
  with:
    php-version: '8.3'
    extensions: bcmath

Audit where the override is used

  1. Grep CI scripts and Dockerfiles for ignore-platform-req.
  2. Replace blanket forms with a specific =ext-name or =php.
  3. Confirm the production image has every requirement the override silenced.

How to prevent it

  • Prefer installing the real extension/PHP over ignoring the requirement.
  • When an override is unavoidable, scope it to a single named requirement.
  • Assert critical extensions with php -m after install.

Related guides

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