Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Programming»PHP»How To Install PHP Composer on Ubuntu 18.04 & 16.04

    How To Install PHP Composer on Ubuntu 18.04 & 16.04

    RahulBy RahulJuly 25, 20152 Mins ReadUpdated:December 10, 2021

    The PHP Composer is a package 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 the single command. We don’t need to search for each library to install.

    This tutorial helps you to install and configure PHP composer on Ubuntu 19.10, Ubuntu 18.04 LTS, and Ubuntu 16.04 LTS systems.

    1. Prerequisites

    • Shell access to a running Ubuntu system with sudo privilege.
    • PHP must be installed and configured, version 5.3 or higher.

    2. Install Composer on Ubuntu

    To install PHP composer on an Ubuntu system. We just need to download the composer executable and put it 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.

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

    After installation of the composer on your system. Type composer at the command prompt. This will provide you with composer version details along with options available with the composer command.

    composer 
    

    Output:

      / ____/___  ____ ___  ____  ____  ________  _____
     / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
    / /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
    \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                        /_/
    Composer version 2.1.14 2021-11-30 10:51:43
    
    Usage:
      command [options] [arguments]
    
    Options:
      -h, --help                     Display this help message
      -q, --quiet                    Do not output any message
      -V, --version                  Display this application version
          --ansi                     Force ANSI output
          --no-ansi                  Disable ANSI output
      -n, --no-interaction           Do not ask any interactive question
          --profile                  Display timing and memory usage information
          --no-plugins               Whether to disable plugins.
      -d, --working-dir=WORKING-DIR  If specified, use the given directory as working directory.
          --no-cache                 Prevent use of the cache
    

    3. Upgrade Composer

    You can download the latest version of the composer by executing the same commands used for installation. The composer also has the capabilities to update itself. Use the following command to update the composer itself.

    sudo composer self-update 
    

    Conclusion

    This tutorial described you to install PHP Composer on Ubuntu systems. Also provides commands to upgrade composer with a single command.

    composer PHP
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Add Swap on CentOS & RHEL 8/7/6
    Next Article How to Clear Memory Cache in Linux

    Related Posts

    How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04

    Updated:May 9, 20223 Mins Read

    How To Install Linux, Nginx, MySQL, & PHP (LEMP Stack) on Ubuntu 22.04

    Updated:April 7, 20227 Mins Read

    How To Install LAMP Stack on Ubuntu 22.04 LTS

    Updated:April 20, 20225 Mins Read

    How To Setup Apache, PHP & MongoDB in Ubuntu & Debian

    Updated:October 8, 20213 Mins Read

    How To Install and Use PHP Composer on Debian 11

    Updated:February 16, 20224 Mins Read

    How To Install PHP (8.1, 7.4 & 5.6) on Debian 11

    Updated:February 16, 20224 Mins Read

    10 Comments

    1. suman on February 17, 2021 11:23 am

      Now its working.
      Thanks

      Reply
    2. bahador on June 16, 2020 3:48 am

      still works tnx.

      Reply
    3. _i_be_me_ on May 23, 2020 3:28 pm

      i don’t have directory “bin” in usr/local/, instead there is a directory “sbin”.
      what should i do?

      Reply
    4. Ezequiel on February 12, 2020 4:34 am

      it worked for me, thanks

      Reply
    5. developer avijit on January 5, 2020 7:25 am

      wow.i love your posts.
      Thank You Very Much

      Reply
    6. Lyanna on October 22, 2019 3:37 pm

      Thank you!

      Reply
    7. leo on October 19, 2019 7:40 pm

      Thk u dude this is ok tuto!

      Reply
    8. Kemal on June 20, 2019 2:40 pm

      Thanks

      Reply
    9. Edwing on January 20, 2019 3:47 pm

      Thanks !!!

      Reply
    10. acakojic on May 31, 2018 9:33 pm

      Thanks you!

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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