How to Installing Composer on Mac?

Quick installation for composer. Open up your terminal and run the code below to get installation setup in your system.

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"php -r "if (hash_file('sha384', 'composer-setup.php') === 'c31c1e292ad7be5f49291169c0ac8f683499edddcfd4e42232982d0fd193004208a58ff6f353fde0012d35fdd72bc394') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"php composer-setup.phpphp -r "unlink('composer-setup.php');"

Then you can create an alias in your bash profile for your composer to make it shorter. Run the following code below in your terminal.

my@computer: cd ~ # go to your home folder
my@computer: nano .bash_profile # to open up .bash_profile then add alias for your composer
# the alias composer example on my systemalias composer="php /usr/local/bin/composer.phar"

--

--