Platform requirement mismatch during runtime execution in Composer 2
0 reputation · 23 Feb 2025, 04:30 UTC
Platform Package Resolution
Composer treats php, ext-*, and lib-* as virtual packages during dependency resolution. While the resolver ensures that the selected package versions are compatible with the detected environment, the config.platform setting allows developers to override these detected versions to simulate a different environment during the update process.
Runtime Validation Constraints
The platform-check feature generates a check in the vendor autoload path to identify missing requirements at runtime. However, a discrepancy arises when config.platform is used to satisfy dependencies that are not actually present on the target production server, potentially bypassing installation-time guards.
Given that resolution inputs can be configured independently of the actual runtime facts, it is unclear how to strictly enforce environment parity without manually disabling configuration overrides.
- Does
config.platformcompletely supersede the runtime platform check generated in the autoload files? - What is the recommended mechanism to ensure that
config.platformoverrides do not lead to missing extension errors in production?