To consolidate and centralize the management of dependencies can be a real problem for complex cloud applications. That is why the right decision here is to use already proven on the market dependency management tools.
Composer is one of the most popular dependency management solution for PHP, inspired by node’s npm and ruby’s bundler. It smartly manages all the required libraries and packages for your application. Running on a per-project basis, Composer determines which versions of which packages your project depends on and installs them in a working directory. Moreover, this tool provides automatic updates load, allowing to keep your packages actual.
Follow the instruction below to install PHP Composer via Jelastic SSH Gateway and perform its configuration, that will enable us to execute it from any working directory throughout a server.
3. Rename the composer.phar file to just“composer”and move it to the private bin directory with the below commands:
mkdir ~/binmv ~/composer.phar ~/bin/composer
4. Now, let’s add Composer to the server PATH variable in order to be able to further execute it from any server directory. In such a way, you won’t have to write out the full path (i.e. /var/www/bin/composer) for calling this dependencies manager when necessary.
For that, run one of the following commands depending on used application server: