There are two ways to use Composer: either download the file composer.phar
(phar stands for PHP Archive) and place it in your working directory, or install it globally.
If you downloaded the phar, you need to run Composer commands like this:
php composer.phar <command>
But if you installed it globally (by running Composer-Setup.exe
on Windows, or placing composer.phar
in /usr/local/bin/composer
on Linux), you need to run it like this:
composer <command>
(where you replace <command>
with one of the available commands, such as install
, update
or self-update
)
It seems like you have installed Composer globally, but are running it with php composer.phar
. Because the file composer.phar
does not exist in your current directory, it returns the 'Could not open input file' error.
For more information, see the chapter 'Using Composer' in the Composer documentation.