Install Composer When Using macOS

If you use macOS and you want to install composer, you can use the steps below:

Download composer:

php -r "copy('http://getcomposer.org/installer', 'composer-setup.php');"

Install composer to /usr/local/bin

php composer-setup.php --install-dir=/usr/local/bin --filename=composer

Unlink composer-setup.php

php -r "unlink('composer-setup.php');"

Check result

composer -V

should return something like this:

Composer version 1.4.2 2017-05-17 08:17:52