One of the package managers for PHP is called “Composer”, and is actually very popular since platforms like Magento uses it. In this article, we will learn how to install and setup composer tool on Linux distributions.
And if you want to know more about Composer, as mentioned earlier, it is a package manager for PHP. It basically checks which other packages (dependencies) that are required by the project and facilitates you to install and update them. It is similar to the npm that the node has. You may learn more bout Composer on the official website here.
Now let’s get started with the steps for installing the popular dependencies manager for PHP on Linux.
Installing Composer on Linux
Before installing the Composer, you must have PHP installed on your system. PHP is easy to install, just use the installation command for your distribution.
Installing PHP on Ubuntu/Debian and their derivatives.
For Redhat family, CentOS, Fedora, etc
Similarly, use the package manager for your particular distribution to install PHP.
After the PHP installation, now you can easily install Composer. So let’s download the composer installer.
Now you have to move the composer.phar file into the /usr/local/bin directory.
After moving the file, it’s time to make it executable.
The installation has completed, now you can use the composer command-line tool.
In future if you want to update the Composer then use this command.