0

I tried installing it for windows and ubuntu in either case i got the same error:Could not open input file: composer.phar

I am not messing with the env path variables. I have openssl uncomented in php.ini. It will be great if any assistance is given by a YII expert. As i am unable to get the YII 2.0 working.

zishe
  • 10,665
  • 12
  • 64
  • 103
Jignesh Rawal
  • 521
  • 6
  • 17
  • See my answer; I'm assuming that you're running Composer with `php composer.phar `. If not, please tell us how you're getting the error. – Nic Wortel May 01 '14 at 13:02
  • By the way, it seems like this is a duplicate question. See [could not input open file: composer.phar](http://stackoverflow.com/q/20769980/1001110), [Could not open input file: composer.phar error in symfony2 using wamp](http://stackoverflow.com/q/21670709/1001110) and [How to run composer from anywhere?](http://stackoverflow.com/q/11333230/1001110), for instance. Also see https://github.com/composer/composer/issues/1116. Have you even looked up the error message on Google, or did you simply create a question on Stack Overflow without any prior research? – Nic Wortel May 01 '14 at 13:11

1 Answers1

0

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.

Nic Wortel
  • 11,155
  • 6
  • 60
  • 79
  • Nic when i type composer i get the composer dialogue and the help section its only on using the composer.phar i get the above error.And yes i am using it along with php as asked by you. – Jignesh Rawal May 01 '14 at 13:10
  • I don't understand what you're trying to say here. – Nic Wortel May 01 '14 at 13:22