Composer platform config limits during dependency resolution
0 reputation · 31 Aug 2026, 03:07 UTC
Simulating Environment Constraints
Composer allows the definition of a platform configuration within composer.json to simulate specific PHP versions and extensions. This ensures that the dependency solver selects package versions compatible with a target production environment, regardless of the local development setup.
Resolution Uncertainty
When the platform config is used to lock a PHP version lower than the host environment, the solver restricts package versions accordingly. However, it is unclear how the solver handles conflicts when a required package has a hard dependency on a PHP extension that is present on the host but explicitly omitted from the platform configuration.
- Does the solver prioritize the simulated platform over the actual host capabilities during
composer update? - What is the expected behavior when a package constraint requires an extension that is physically installed but logically disabled via the platform config?