Tag Archives: globally

Install Composer on Ubuntu

Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.

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

Open a terminal and move to a directory where you have write access (like your home directory) and then download and run the installer script from the Composer project:

This will create a file called composer.phar in your home directory. This is a PHP archive, and it can be run from the command line.

We want to install it in a globally accessible location though. Also, we want to change the name to composer (without the file extension). We can do this in one step by typing:

Now, type composer in your command line to see the result.

and you can also check the installed version of the composer by typing:

Happy Coding!