Tartar
Tartar

Reputation: 5452

Composer is not working

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.

Upvotes: 0

Views: 11786

Answers (2)

Limon Monte
Limon Monte

Reputation: 54459

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

Upvotes: 1

Rizky Fakkel
Rizky Fakkel

Reputation: 9193

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

Upvotes: 3

Related Questions