How to Install Composer on Mac OS (M1, 2020)

Budi Odank
2 min readFeb 6, 2022

--

You must install php before install composer. You can use php on xampp to install composer.

  1. Download Composer

You can download composer with your terminal

After running command, you can see the file composer.phar in the current directory.

2. Composer Global

To make it global, all you have to do is move the composer.phar file to /usr/local/bin/composer

mv composer.phar /usr/local/bin/composer

If the composer folder is not found, then you have to create the folder first.

Now, you must setting on your shell profile

sudo nano ~/.zshrc

Add alias composer=”php /usr/local/bin/composer/composer.phar”

Add composer alias on shell profile

After you saving, and restart your terminal. You can you will be able to access composer like below:

composer install

Reference

--

--