Composer is a dependency management tool for PHP similar to npm for nodejs and bundle for ruby. Using composer tool we can define required libraries for our project and install with the composer in the single command. We don’t need to search for each library to install.
This tutorial will help you to install PHP composer on Ubuntu, Debian & LinuxMint operating systems. We are assuming that you already have installed PHP on your system.
#1. Install Composer
To install php composer on Debian based systems. We just need to download composer executable and put under bin directory.
$ curl -sS https://getcomposer.org/installer | php
Now use the following commands to make composer available globally for all users in your system, which can be used for all PHP applications on that system.
$ mv composer.phar /usr/local/bin/composer $ chmod +x /usr/local/bin/composer
To find the version of composer simply use the following command.
# composer -V Composer version 1.4.1 2017-03-10 09:29:45
#2. Upgrade Composer
You can rerun the above commands to upgrade the composer. The composer also has capabilities to update itself. Use the following command to upgrade composer
$ sudo composer self-update