Commit composer.lock and use composer install for reproducible PHP deploys
Commit composer.lock and run composer install—not composer update—to keep PHP dependency installs deterministic across CI and production.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Commit composer.lock and run composer install—not composer update—to keep PHP dependency installs deterministic across CI and production.
Gate your PHP dependencies with composer audit in CI pipelines. Learn how to integrate Composer's built-in security scanner, verify your environment, and handle the limitations of known-vulnerability detection.
Composer's config.platform setting pins PHP and extension versions in composer.json so dependency resolution stays consistent across development, CI, and production.
Switch Composer to classmap-authoritative mode to eliminate filesystem scans during class loading in production. This guide covers enabling the setting, regenerating the optimized autoloader, verifying the classmap covers all classes, and rollback steps if dynamic class discovery breaks.
When PHP apps start up, Composer’s default autoloader can add latency. The <code>--optimize-autoloader</code> flag pre‑builds a classmap, cutting file lookups and speeding the first request. Learn how it works, when to use it, and how to verify the gains.
Decide how Composer should generate the autoloader for production: default, --optimize-autoloader, or --classmap-authoritative. Compare build time, runtime latency, and memory, then see a concrete CI setup and validation steps.
Lock the dependency resolution with composer.lock and install exactly those versions. Use composer install, not update, in CI and production for deterministic PHP builds.
PSR-4 keeps composer.json clean, but the default loader checks the filesystem at runtime. Here is how to optimize Composer autoloading for production without breaking your namespace mappings.
Stop bloating your production autoloader. Learn how to use Composer's autoload-dev to separate test namespaces from application logic for better performance and cleaner builds.