How To Install Composer On CentOS/RHEL/Fedora System

Composer is a dependency manager for PHP. It allows you to declare the dependent libraries for your project needs. It is used in all modern PHP frameworks and it is one of the most recommended tools that solves fundamental issue in the majority of web projects.

In this article I will guide you how you can install composer on your Linux Systems.

Composer solves the below problems:

  • Resolve dependency for PHP packages
  • Auto-loading solution for PHP packages
  • It keep all packages up to date.

Install Composer

Follow the below commands to install composer.

# mkdir /download
#cd /download

Now download composer.phar file.

# curl -sS https://getcomposer.org/installer | php
# ls -l
total 1800
-rwxr-xr-x 1 root web1 1836198 Mar 29 03:55 composer.phar

Now move it to /usr/local/bin/.

# mv composer.phar /usr/local/bin/composer

Sometime above command may fail because the usr directory doesn’t exist. In this case create the directory structure first and then move the file as usual.

# which composer

Now you can use the composer command globally.

# composer

That’s it.

I hope this article will help to install composer on CentOS/RHEL/Fedora systems. If you have any queries and problem please comment in comment section.


Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author


Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

1 Comment

Leave a Comment