How to Install Composer on RHEL or CentOS
In simple terms, it is a PHP application-level package manager you can use to declare the libraries your project depends on and it manage them. The development of the system was led by Nils Adermann and Jordi Boggiano. Composers are PHP tools for managing dependencies. Composers use Packagist.org as their main bundle providers. These files are accessed from repositories submitted by users. Among other features, Packagist.org provides version control or integration with GitHub or Bitbucket.
Throughout this tutorial, we’ll walk you through the steps to install PHP Composer on RHEL or CentOS.
In order for the composer to work, PHP needs to be installed, so make sure that PHP is available.
Check if PHP is installed on your system by running the following command,
# php --version
After you have PHP, We must then install dependencies.
# sudo dnf install wget -y
You will then need to download and run the Composer installer script,
# sudo wget https://getcomposer.org/installer -O composer-installer.php
Use the following command to add Composer to the /usr/bin directory,
# sudo php composer-installer.php --filename=composer --install-dir=/usr/bin
Type the following commands to verify the composer installation,
Make sure the composer version is up to date,
# composer --version
To update the composer, execute the following command,
# composer self-update
Thank you for reading, that’s all for now. Please refer to the internet for more information. I hope you found it informative.