Q:

composer mac

curl -sS https://getcomposer.org/installer | php
php composer.phar install
mv composer.phar /usr/local/bin/composer
open -e  ~/.zshrc
// or open -e  ~/.bash_profile
alias composer="php /usr/local/bin/composer"
2
Open a terminal and navigate to your user directory, ie cd /User/<USER_NAME>/
Run this command shown below to download Composer. This will create a Phar (PHP Archive) file called
composer.phar:

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

Now we move 
composer.phar file to a directory
sudo mv composer.phar /usr/local/bin/

We want to run Composer with having to be root al the time, so we need to change the permissions:
sudo chmod 755 /usr/local/bin/composer.phar
 
Next, we need to let Bash know where to execute Composer: 
nano ~/.bash_profile

Add this line below to bash_profile and save
 
alias composer="php /usr/local/bin/composer.phar"
and then run this command:
 
source ~/.bash_profile
 
Finally, run: 
composer -v
1
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
1
php composer-setup.php --install-dir=bin --filename=composer
0
// Adding permissions after installing Composer on Mac OSX
sudo chmod 755 /usr/local/bin/composer.phar
0

New to Communities?

Join the community