# Check Composer Dependencies Against the Deployment PHP Runtime

https://ferkesh.net/zh/knowledgebase/article/composer-lock-platform-deployment

composer.lock records the resolved dependency versions when present. It does not install a PHP extension or guarantee that the runtime serving requests matches the build machine. Validate the artifact against a representative deployment environment.

![Reviewed lock: Resolved package versions; Actual platform: PHP and extensions; Release decision: Smoke test or rebuild.](https://ferkesh.net/kb-media/ferkesh-guide-diagrams-batch-15.svg#composer-lock-platform-deployment)

## Install from the reviewed lock file

On staging or CI with a committed lock file, use your project's reviewed installation flags, for example composer install --no-dev --no-interaction. Keep scripts and allowed plugins within your approved dependency policy. Avoid composer update during release deployment because it can resolve new versions and change the lock file.

## Verify the real platform

Under the PHP binary used for this deployment check, run composer check-platform-reqs --no-dev. This checks the real PHP and extensions and ignores a simulated config.platform setting for the validation. If CLI and web are separate, check the effective web runtime too.

## Block invalid artifacts

Investigate a failed requirement and fix the intended environment or dependency in a controlled build, instead of suppressing checks. Record the lock file hash, PHP runtime and source revision. Confirm an application-level smoke test on staging, and keep the previous compatible artifact ready for rollback.

## Related Ferkesh Knowledge Base guides

- [How to Compare PHP Settings for Web and CLI Runs](https://ferkesh.net/knowledgebase/article/php-web-cli-configuration-mismatch)
- [How to Check WordPress Plugins Before Upgrading PHP](https://ferkesh.net/knowledgebase/article/wordpress-plugin-new-php-compatibility)

## Official references

- [Command-line interface / Commands - Composer](https://getcomposer.org/doc/03-cli.md)

Last reviewed November 27, 2026.
