1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Execute Composer via SSH
This guide explains how to execute the open-source dependency manager Composer 1 and 2 using an SSH command.
Composer is an open-source dependency manager for PHP that allows managing libraries and packages required for a specific PHP project. It enables developers to define the libraries their application needs and install them consistently, making dependency management easier for complex PHP applications.
Starting from version 2.2 of Composer, it's necessary to have at least PHP 7.2.5 (PHP 5.x is no longer supported and is not recommended for modern projects).
Executing Composer
To use Composer on your hosting, you need to connect to your server via SSH and install Composer on your hosting by specifying the following command:
Composer
... for Composer 1.x !
Composer2
... for Composer 2 !
You can also use the following alias to install the version compatible with the PHP version installed on your hosting:
Composer --version
... which will output, for example, Composer version 2.5.0 2022-12-20 10:44:08
Composer_php5.6 --version
... will output Composer version 1.8.6 2019-06-11 15:03:05