Composer is a tool that allows you to install PHP libraries for your individual projects within cPanel.
It is strongly recommended you install Composer into your own cPanel account, and not rely on on the server’s native composer version which may change without notice.

1. To install Composer, open up terminal or SSH directly into the server:

2. Paste the following commands into the terminal and execute the commands

cd ~
mkdir bin
mkdir bin/composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar bin/composer
alias composer="/usr/local/bin/php ~/bin/composer/composer.phar"
source ~/.bashrc
composer --version

3. Verify the version of Composer installed, ie v2.1.3

To install a specific version of Composer, you can run the following commands while specifying the version you want

cd ~
cd bin/composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --version=[YOUR_COMPOSER_VERSION]   
composer --version 

Composer Manual Download & Version Numbers: https://getcomposer.org/download/

Leave a Reply

Your email address will not be published. Required fields are marked *