PHP Package Management via Composer
Composer is the industry standard for managing libraries in PHP projects. It is pre-installed on our servers and can be used directly via the cPanel terminal or an SSH connection.
Common Commands
Navigate to your project directory (e.g., cd public_html) and use the following commands:
| Command | Function |
|---|---|
composer install |
Installs all packages from the composer.lock file. |
composer update |
Updates your packages to the latest versions. |
composer require [name] |
Adds a new package to your project. |
Troubleshooting: PHP Version
By default, Composer uses the system's PHP version in the terminal. If your project requires a different version (e.g., PHP 8.2), call the specific PHP interpreter directly:
Tip: Always use Composer inside your project folder
to ensure a clean vendor structure.