• Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 20.04
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install PHP Composer on CentOS/RHEL 8/7

Written by Rahul, Updated on April 19, 2020

Composer is a dependency management tool for PHP similar to npm for nodejs and bundle for ruby. Using the composer tool we can define required libraries for our project and install it with the composer in a single command. We don’t need to search for each library individually to install each time.

This tutorial will help you to install PHP Composer on CentOS, RHEL & Fedora operating systems. We are assuming that you already have installed PHP on your system.

Prerequsitis

  • Sudo privileged account with shell access.
  • You must have PHP installed on your system.

Install Composer on CentOS

To install php composer on Redhat 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.10.5 2020-04-10 11:44:22

Update Composer

If there is any upgrade available, Composer displays the information with every run. Composer is build with the ability to upgrade itself. You just need to run following command to update composer.phar to the latest version.

composer self-update

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

1 Comment

  1. Avatar Sankaran Reply
    October 19, 2016 at 7:47 am

    when I given composer -V its not getting composer information.

Leave a Reply Cancel reply

Popular Posts

  • How to View or List Cron Jobs in Linux
  • How to Install PHP 8 on Ubuntu 20.04
  • How to Set Up SSH Tunnel with PuTTY
  • How to Install Tor Browser on Ubuntu 20.04
  • Issue with phpMyAdmin and PHP: Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”
  • How to Allow Remote Connections to MySQL
  • How to Install MySQL 8.0 on Ubuntu 20.04
  • How to Install Apache Kafka on Ubuntu 20.04
© 2013-2021 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy