May Sale! All accounts are 40% off this week.

fatima1's avatar

composer not found

hi all i uninstall composer then reinstall it and set every thing

now when i type php compser.phar in terminal it give me composer and everything is fine but when i write composer it give -bash: composer: command not found

what can i do for that??

0 likes
4 replies
manelgavalda's avatar

Are you adding composer to your path? If you are using bash:

echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc

To reload the .bashrc file

source ~/.bashrc
fatima1's avatar

@GLOBALS - i type cho $PATH

~/.composer/vendor/bin:~/.composer/vendor/bin:~/.composer/vendor/bin:~/.composer/vendor/bin:~/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

manelgavalda's avatar
Level 50

@FATIMA1 - Have you renamed your composer.pharto just composer and moved it to a folder in the $PATH?:

mv composer.phar /usr/local/bin/composer

/usr/local/bin is already added in your path, so it should work, then with the command I said above you will have your global composer packages available.

Please or to participate in this conversation.