Composer installs the PHP libraries declared by an application. On a production deployment, use the reviewed lockfile so the installed dependency versions match the tested release. An update operation can select new versions and should be treated as a separate development and testing change.
IN THIS ARTICLE
Check access and requirements
Confirm the project composer.json and composer.lock are trusted and available in the intended application directory. Check the selected PHP version and required extensions. Package scripts and plugins can execute code, so do not run an unknown project merely to inspect it.
01 Install PHP application dependencies with Plesk Composer
- Open the domain Composer or PHP Composer tool when available and select the detected project. Verify that it points to the intended manifest rather than another application.
- Review PHP compatibility and extension requirements before installing. The web runtime and command-line runtime must both satisfy the project where the application uses each.
- Choose the install workflow for the locked release. Review production options such as excluding development dependencies only when they fit the application build and runtime requirements.
- Read the complete result, including script failures. Dependency download success is not enough if a required post-install step failed.
- Deploy the application public directory correctly and test the website. Keep Composer manifests, credentials and unnecessary project metadata out of publicly downloadable locations.
02 Example: install a reviewed production lockfile
If shell access is permitted, run these as the application's hosting user in its trusted project directory. First confirm that composer runs with the PHP release required by the application. This example assumes the release plan explicitly excludes development dependencies:
composer install --no-dev --optimize-autoloader
composer check-platform-reqs --no-dev
The install reads the reviewed composer.lock rather than selecting a new dependency set. The second command checks the installed packages against the actual CLI PHP and extensions. Read script failures as well as dependency-download results, and separately test the domain's web runtime.
Use the provider's documented Plesk PHP/Composer invocation if the default shell executable is different. Do not run this as root or against an unknown repository. If frontend builds or deployment scripts require development packages, prepare those build artifacts through the tested release process instead of blindly adding --no-dev. Recover the previous tested code and vendor directory together if the release cannot complete.
How do I verify the installed PHP dependencies?
Confirm the expected dependency versions and successful application startup. Run the application supported health checks and inspect logs for missing classes or extensions. Verify that no secrets were committed or exposed in the deployment.
Resolve setup problems
For a platform-requirement error, install or select the supported runtime rather than bypassing all checks. For memory or download errors, review the CLI environment and connectivity with the administrator. Do not use an unrestricted update on production as the first response to an install failure. Restore the previous tested code and dependency set if the release cannot be completed safely.