Unable to install composer on OS X

I did this on the terminal:

$ curl -sS https://getcomposer.org/installer | php

the conclusion 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

There is no problem with this (it should work because usr / local / bin is in my $ PATH). But how do I run it now? When I enter the composer or composer .phar on the command line, I get:

-bash: composer: command not found
-bash: composer.phar: command not found
+4
source share
3 answers

.pharnot suitable for PH P Ar chive is a format that can read an executable file php, not an executable file. To run it, you should use:

$ php /usr/local/bin/composer.phar

To make your life a little easier, you can of course define an alias:

$ alias composer="php /usr/local/bin/composer.phar"

And then just call composerfrom your shell.

+6

, ? ls -al /usr/local/bin .

, : sudo chmod a+x /usr/local/bin/composer.phar

, composer.phar, ur mv, : sudo mv composer.phar /usr/local/bin/composer

+1

Have you created the composer.phar executable? if not, just do sudo chmod a + x / usr / local / bin / composer.phar

0
source

Source: https://habr.com/ru/post/1569122/


All Articles