Could not open input file: composer.phar error in Symfony 2. SOLVED.

php-elephant

This is a common issue that is related to bad installation of our favorite PHP package manager: Composer. Let’s fix it:

Open your terminal and run following comand in order to get the latest version of Composer:

curl -sS https://getcomposer.org/installer | php

I recommend you to move the composer.phar file to a global “bin” directory, in my case (macOS) the path is:

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

Create an alias for easy access:

alias composer='/usr/local/bin/composer.phar'

If everything is ok, now it is time to verify our Composer version:

composer --version

That’s it! Start making great Symfony 2 projects 🙂

2 comments on “Could not open input file: composer.phar error in Symfony 2. SOLVED.”

  1. I followed all these steps on my mac, but when I run composer –version, I still get the error:
    /usr/local/bin/composer.phar: No such file or directory

    Any idea what might be the problem?

Leave a Reply

Your email address will not be published. Required fields are marked *