brew install composer
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"
/* Step 1 */
install homebrew
/* Step 2 */
brew install composer
Run the below commands inside the Terminal:
Step 1.
sudo php -r "copy('https://getcomposer.org/installer','composer-setup.php');"
Step 2.
php composer-setup.php
Step 3.
sudo mv composer.phar /usr/local/bin/composer
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer
sudo composer self-update