0

I have installed Composer Globally as this docs shows and it works for root user on my server CentOS 6.6 but as a normal user lets said webvm user it doesn't saying that composer is not found (see below):

[webvm@webvm ~]$ sudo composer [sudo] password for webvm: sudo: composer: command not found 

Do I need to setup something else in order to get composer working from a non root user? webvm is in sudoers file so I not know what I'm missing here, any advice?

1
  • I'd like to point out that composer should NOT be run as root, and sudo composer should not be run in the normal course of development or deployment. The unprivileged application/webserver user should be using composer WITHOUT sudo. The only time I'd even consider sudo composer would be with the self-update command, never install or update. Commented Dec 30, 2014 at 22:47

1 Answer 1

1

One of two issues are likely reasons:

  • Either it's not in webvms $PATH
  • It's only executable for root. Check the permissions
6
  • This are the permissions for the file -rwxr-xr-x 1 root root 1029339 Dec 1 20:01 /usr/local/bin/composer how I can fix the issue? What I should do on my server in order to get composer working out of root user? Commented Dec 2, 2014 at 11:50
  • See if sudo /usr/local/bin/composer works. If it does, you have to add /usr/local/bin to your $PATH. Commented Dec 2, 2014 at 11:52
  • That works, where I should add this to the $PATH? In home/webvm/.bashrc file? What line I should add? Commented Dec 2, 2014 at 11:54
  • @ReynierPM: Server Fault is a site for pro admins. You are expected to know such fundamentals or be able to learn them yourself. Google exists. And yes, ~/.bashrc might be an option if you use bash. Commented Dec 2, 2014 at 11:56
  • I have run the command echo "$PATH" and I able to see the route where composer file is: /usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/webvm/bin then why isn't executed? Commented Dec 2, 2014 at 12:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.