Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Below are the steps on MacOS Composer Installation.
- Open your terminal and type this command:
curl -sS https://getcomposer.org/installer | php
- Move the
composer.pharfile into bin directory to make it global and can be accessible anywhere.
sudo mv composer.phar /usr/local/bin/
- Change the composer permission to run as root all the time
sudo chmod 755 /usr/local/bin/composer.phar
- Run the
nano ~/.bash_profilecommand and add the line below to link the executable file when running the composer command
alias composer="php /usr/local/bin/composer.phar"
- Lastly, run the command below.
I created a short video if you want to see it visually regarding the MacOS Composer Installation.
If you have any queries, please do comment below or contact me via email.