2.8.3.1. Installing Composer
Composer 2.x is installed on the hosting by default, you do not need to install it separately.
- Connect to hosting via SSH.
- Run the commands:
cd ~ && wget https://getcomposer.org/download/1.10.26/composer.phar chmod +x composer.phar mv composer.phar composer
In the first command, instead of
1.10.26
substitute the desired Composer version number. All versions are listed on official website. - Install the required PHP version and create an alias to launch Composer from any directory in any of the following ways:Open the section "Linux configuration" and set the following parameters:
- Select the required PHP version.
- Add an alias
composer
for the team~/composer
.
Attention!
This method is not recommended, since the parameters specified with its help can be overwritten when manipulating in the section "Linux configuration".Run the following commands in the console:
echo "export PATH=/usr/local/php73/bin:$PATH" >> ~/.bashrc echo "alias composer='~/composer'" >> ~/.bashrc
In the first command, instead of
php73
substitute the required PHP version. - Connect to the hosting via SSH again or run the command:
source ~/.bashrc
- Check Composer version:
composer -V