Installing Composer on macOS Big Sur

Installing Composer on macOS Big Sur

Composer is a cross-platform dependency manager for PHP libraries.


In this guide, I am installing Composer on my macOS Big Sur.


First navigate to the user directory, i.e cd/User/

Run the command shown below to download composer to the navigated directory:                 


sudo curl -sS https://getcomposer.org/installer | php


We need to create a directory, so run the following command to create a directory:


sudo mkdir -p /usr/local/bin


Now, we need to move composer.phar to the created directory Run the command:


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


Now, we need to let Bash know the path to the Composer, so run the command


nano ~/.bash_profile


Add the below code to the bash_profile and save 


alias composer="/usr/local/bin/composer.phar"


Now, run the following command to specify the source for bash_profile


source ~/.bash_profile


Finally, run the following command to check whether the installation was successful


composer

Recent comments(0)

Please, Sign In to leave a reply