Installing composer globally

An example of composer installation will be from Ubuntu OS, but on other UNIX-like operating systems the commands will be identical. Start the console (terminal) and run the following command:

https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

After that we will receive a notification about the successful installation of the composer.

We can check, execute the command:

composer -h

And we get the following:

Or so:

composer

And we get the following:

Done, you can start using the composer dependency manager.

Installing composer locally

Example installation composer local, i.e. start the composer in the desired project folder. Open the console (terminal), go to the desired project folder and execute the composer setup command:

curl -sS https://getcomposer.org/installer | php

After that we can check the work with the command:

php composer.phar -h