How to Install Composer on RHEL/CentOS 7, 8
Composer is an application-level package manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries.
In this article, we’re going to install composer on CentOS 7/8. Let’s start:
Table of Contents
Installation
At first, ensure that we’ve installed PHP by this command:
php --version
If PHP is not available on your machine, then please install PHP first. Then we need to install dependencies:
sudo dnf install wget -y # CentOS 8
sudo yum install wget -y # CentOS 7
Download the Composer installer script:
sudo wget https://getcomposer.org/installer -O composer-installer.php
Run the following command to install Composer in the /usr/bin
directory:
sudo php composer-installer.php --filename=composer --install-dir=/usr/bin
You’ll set the output like:
All settings correct for using Composer
Downloading...
Composer (version 1.10.13) successfully installed to: /usr/bin/composer
Use it: php /usr/bin/composer
Verify the installation by typing:
composer

Version Check
Run this command to see the current version of composer:
composer -V
#Or
composer --version
Update Composer
We can easily update composer to latest version. Just run this command:
composer self-update
That’s it. Thanks for reading. ?
Comment
Preview may take a few seconds to load.
Markdown Basics
Below you will find some common used markdown syntax. For a deeper dive in Markdown check out this Cheat Sheet
Bold & Italic
Italics *asterisks*
Bold **double asterisks**
Code
Inline Code
`backtick`Code Block```
Three back ticks and then enter your code blocks here.
```
Headers
# This is a Heading 1
## This is a Heading 2
### This is a Heading 3
Quotes
> type a greater than sign and start typing your quote.
Links
You can add links by adding text inside of [] and the link inside of (), like so:
Lists
To add a numbered list you can simply start with a number and a ., like so:
1. The first item in my list
For an unordered list, you can add a dash -, like so:
- The start of my list
Images
You can add images by selecting the image icon, which will upload and add an image to the editor, or you can manually add the image by adding an exclamation !, followed by the alt text inside of [], and the image URL inside of (), like so:
Dividers
To add a divider you can add three dashes or three asterisks:
--- or ***

Comments (0)