Better use $HOME instead of ~ .
In my .zshrc (I use zsh ) I work this way
export PATH="$PATH:$HOME/.composer/vendor/bin"
Make sure that your terminal really uses .bashrc and there cannot be .bash_profile , if so, you should edit this file. If you use it from a virtual machine, the user you log in with when calling vagrant ssh is vagrant , not root .
Also, do not forget to upload the file after editing or open a new terminal.
UPDATE
I see that there are answers that put the $PATH path after the composer, so I thought I could tell you what I learned to be the difference.
This is not a random thing that you can put as you want. What you put after rewriting what was before .
This means that if you have something installed on your system and you install a newer version of the package using the composer, it will have the same command as if the composer's path does not follow the path to the system, you will need to specify the full path to the vendor/bin binary inner composer in order to execute it.
source share