Installing Composer.phar

published by on


What is composer?

Now we don't have to reinvent wheel, we can select the tyre, the rim, the gauge and Composer will give us these components so that they will work together without compatibility issues. Me

Composer is the dependency manager for PHP. That means that chunks of php code, which are tested and and each package solves one some problem are packed into a packages and added to packagist repository. Using composer we can get those packages and add them into our codebase, and so reuse the stable code.

How to install Composer?

I will describe here my prefered globbal installation as the documentation for Composer is great on their website.

    curl -sS | php

Run the above command to download the latest version of composer.phar file using curl and you should see something like this

    #!/usr/bin/env php
    All settings correct for using Composer
    Composer successfully installed to: /var/www/
    Use it: php composer.phar

Now we will move composer.phar to binary folder, so that it is available globally in system and we rename it to composer

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

Therefore we will be able to use it anywhere without php just by calling


which will do the same, as if we would run php composer.phar

Tags: php composer