I did this on terminal:
$ curl -sS https://getcomposer.org/installer | php
the output was:
All settings correct for using Composer
Downloading...
Composer successfully installed to: /Applications/XAMPP/xamppfiles/htdocs/composer.phar
Use it: php composer.phar
then I entered:
$ sudo mv composer.phar /usr/local/bin
No issues with this (it should work because usr/local/bin is in my $PATH). But how do I run it now? When I enter composer or composer.phar on the command line, I get:
-bash: composer: command not found
-bash: composer.phar: command not found
.phar
is short for PHP Archive - it's a format that the php
executable can read, not an executable on it's own right. To run it you should use:
$ php /usr/local/bin/composer.phar
To make your life a tad easier you could, of course, define an alias:
$ alias composer="php /usr/local/bin/composer.phar"
And then just call composer
from your shell.
Did u check what do u have now in your path
ls -al /usr/local/bin
Check the right to execute.
To be sure u can do:
sudo chmod a+x /usr/local/bin/composer.phar
First look like should be composer.phar as you did not precise a new name in ur mv command like:
sudo mv composer.phar /usr/local/bin/composer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With