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:
1 |
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:
1 |
mv composer.phar /usr/local/bin/composer.phar |
Create an alias for easy access:
1 |
alias composer='/usr/local/bin/composer.phar' |
If everything is ok, now it is time to verify our Composer version:
1 |
composer --version |
That’s it! Start making great Symfony 2 projects 🙂
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?
Hi Ann, did you create the alias to composer?