0

I am new to Composer and trying to install a package via composer as

$ php composer require intervention/image

but i am getting

Could not open input file: composer

error since i have just run my last composer command 10 mins ago. I don't now what is causing that problem. Any help would be appreciated.

Ravan Scafi
  • 6,382
  • 2
  • 24
  • 32
Tartar
  • 5,149
  • 16
  • 63
  • 104

2 Answers2

3

Try the following, then execute your command again.

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

Then you can use composer instead of php composer ...

Source

Community
  • 1
  • 1
Rizky Fakkel
  • 8,703
  • 1
  • 14
  • 20
1

Most probably in your case Composer was installed globally, as a stanalone application.

Instead of

php composer require intervention/image

run

composer require intervention/image
Limon Monte
  • 52,539
  • 45
  • 182
  • 213
  • i used to run my composer commands with php at the start of them and they were working properly. Not sure what has changed. – Tartar Apr 08 '15 at 13:07