Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Programming»PHP»How to Install PHP Composer on CentOS/RHEL 8/7

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

    By RahulApril 19, 20202 Mins Read

    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.

    Advertisement

    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
    

    composer PHP
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    PHP Arrays: A Beginner’s Guide

    Running Laravel Queue Worker as a Systemd Service

    How to Change PHP Session Timeout

    View 1 Comment

    1 Comment

    1. Sankaran on October 19, 2016 7:47 am

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

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Configure Postfix to Use Gmail SMTP on Ubuntu & Debian
    • PHP Arrays: A Beginner’s Guide
    • Deploying Flask Application on Ubuntu (Apache+WSGI)
    • OpenSSL: Working with SSL Certificates, Private Keys and CSRs
    • How to Create and Read List in Python
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.