How to Install or Update Composer in cPanel Using PHP 8.3
- By Mehta Websolution
- Publish Date: 28/10/2025
Introduction
Composer is the dependency manager for PHP. It allows you to manage project libraries and dependencies easily. If you are hosting your PHP project on cPanel, here is a simple guide to install or update Composer using PHP 8.3.
Step 1: Navigate to Your Project Folder
Open your SSH terminal and go to the folder where your project is located:
cd /home/your-username/public_html/your-project-folder/
Replace your-username and your-project-folder with your actual cPanel username and project folder name.
Step 2: Download Composer
Download the Composer PHAR file directly into your project folder:
curl -sS https://getcomposer.org/composer.phar -o composer.phar
Step 3: Make Composer Executable
chmod +x composer.phar
Step 4: Run Composer with PHP 8.3
To update dependencies in your project:
ea-php83 php composer.phar update
To install the versions locked in composer.lock without changing them:
ea-php8.3 php composer.phar install
Step 5: Optional Create a Shortcut
Rename the Composer file for easier usage:
mv composer.phar composer
Now you can run:
./composer update
# or explicitly with PHP
ea-php83 ./composer update
One-Line Copy-Paste Command
This command downloads Composer, makes it executable, and runs an update in a single step:
cd /home/your-username/public_html/your-project-folder/ &&
curl -sS https://getcomposer.org/composer.phar -o composer.phar &&
chmod +x composer.phar &&
ea-php83 php composer.phar update
Notes and Best Practices
Always back up composer.json and composer.lock before updating.
Use install on production servers to avoid unintentionally updating dependencies.
Verify the PHP CLI version matches your site:
ea-php83 php -v
If your server uses a different PHP binary, replace ea-php83 accordingly.
This method works for any cPanel user and keeps Composer project-specific, avoiding system-wide installation issues.