HOW TO: INSTALL COMPOSER ON LINUX MINT

About Composer

A composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.

Composer is not a package manager in the same sense as Yum or Apt are. Yes, it deals with “packages” or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. By default, it does not install anything globally. Thus, it is a dependency manager. It does, however, support a “global” project for convenience via the global command.

System Requirement

Composer requires PHP 5.3.2+ to run. A few sensitive PHP settings and compile flags are also required, but when using the installer you will be warned about any incompatibilities.

Now, Follow the below Steps to Install Composer on Linux Mint

Step 1 :- If you haven’t installed PHP then first install it with the below Command or you’ve already installed then continue with the 2nd Step.

sudo apt install php

Step 2 :- While on your home folder on the terminal create a file for the script.

touch composer.sh

Step 3 :- Open this file with your favourite editor, for this example, I’ve used Sublime and Paste the Below Code.

Step 4 :- Make the script executable, run the below command:

sudo chmod +x composer.sh

Step 5 :- Run the file:

sudo ./composer.sh

Note :- No output means it all went ok and it has created a composer.phar file in the same directory.

Step 6 :- Now, move composer.phar to make it available anywhere within the system:

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

Step 7 :- Now, Check that composer is installed or not by simply running the below command:

composer

That’s it, you’re done! You can visit the official website by clicking here.

Follow Me on
Latest posts by Sushant Kumar (see all)
Total Page Visits: 83 - Today Page Visits: 0