1252748
1252748

Reputation: 15369

Composer requires sudo for simple -V command

I'm trying to set up Composer for use with Heroku, but am running into problems. I've followed the download steps here which generates the composer.phar file. I then moved it to /usr/local/bin/composer per the instructions here. Now when running composer from CLI I get the error

Could not open input file: /Users/myusername/.composer/composer.phar

sudo composer -V gets me the version number,but with the warning

Do not run Composer as root/super user! See https://getcomposer.org/root for details

The link seems unrelated to a simple -V command, which I can't imagine I should need to sudo to run anyway. I've done this installation pretty much by the book, but it seems like this isn't right.

Upvotes: 1

Views: 788

Answers (1)

Duane Lortie
Duane Lortie

Reputation: 1260

I suspect non-root users do not have execute permissions.. From a shell on my system, I get...

 ls -al /usr/local/bin/composer
-rwxr-xr-x 1 root user 1201562 Dec  8  2015 /usr/local/bin/composer

eg; Full perms for root, read & execute for everyone else. You may need to ..

 sudo chmod 755 /usr/local/bin/composer

Upvotes: 4

Related Questions