How To Install PHP Composer on CentOS 7

Composer is a dependency manager for PHP similar to npm for Node.js or pip for Python.

Composer pulls all the required PHP dependency packages for our project and manage them for us. It is used in all modern PHP frameworks and platforms such as Magento 2, Symfony and Drupal.

In this tutorial, we will go through the steps of installing and using Composer on a CentOS 7 machine.

The following prerequisites must be fulfilled before we continue with this tutorial:

The following steps describe how to install Composer on a CentOS 7 system.

We just need to download composer executable and put under bin directory.

# curl -sS https://getcomposer.org/installer | php

The following commands will make composer available globally for all users in our system, which can be used for all PHP applications on the system.

# mv composer.phar /usr/local/bin/composer
# chmod +x /usr/local/bin/composer

The last step is to verify the installation:

# composer

The command above will print the Composer’s version, commands, and arguments.

______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.8.5 2019-04-09 17:46:47

Usage:
command [options] [arguments]

This completes the Composer installation tutorial. Enjoy using Composer!

Please follow and like us:

ZT Admin

Leave a Reply

Your email address will not be published. Required fields are marked *

Next Post

How to implement HTTP Authentication/Password protect your website in Apache

Fri Nov 15 , 2019
In this tutorial, we will describe the basics of password protecting a website using HTTP authentication. Step 1. First, we need to create password which we will use to login to the site. # htpasswd -c /home/passwords zoomtut New password: ##### Re-type new password: ##### Adding password for user zoomtut […]
Apache http authentication