Composer is a package-level application manager for the PHP programming language that provides tools for managing dependencies within a PHP application.

You will need to connect to the console via SSH, in the case of Windows, for example using Putty.

To install PHP composer, go to the folder and download the executable:

cd /usr/local/src && curl -sS | php  

If you don't have curl, you can download it:

php -r "readfile('');" |  

Now use the following commands to make composer globally available to all users on your system, which can be used for all PHP applications on that system:

mv composer.phar /usr/local/bin/composer  

Options for the composer installer

** -install-dir**

You can install composer to any folder using the "-install-dir" option and the path to the folder. For the example "-install-dir=bin" you can use the following command:

curl -sS | php -- --install-dir=bin  


You can specify the name of the file (by default it is composer.phar) using the "-filename" parameter. For example:

curl -sS | php -- --filename=composer  

You can combine the top two options on one line for ease of use:

curl -sS | sudo php -- --install-dir=/usr/local/bin --filename=composer  


You can install composer of a specific version using the "-version" parameter with the version. For example:

curl -sS | php -- --version=1.0.0-alpha10  

Set permissions on the file:

chmod +x /usr/local/bin/composer  

Or (if you have not renamed the file):

chmod +x /usr/local/bin/composer.phar  

Let's see what version we have installed:

composer -V  

Setting dependencies

Run this at the root of the project:

composer init  


php composer.phar init  

After which we execute:

composer install  

The installation is now complete.

Updated July 30, 2018