Composer is a cross-platform dependency manager for PHP libraries.
In this guide, i'm installing Composer on a machine running Mac OSX with MAMP.
- Open a terminal and navigate to your user directory, ie cd /User/<USER_NAME>/
- Run this command shown below to download Composer. This will create a Phar (PHP Archive) file called
curl -sS https://getcomposer.org/installer | php
- Now we move
composer.phar fileto a directory
sudo mv composer.phar /usr/local/bin/
- We want to run Composer with having to be root al the time, so we need to change the permissions:
sudo chmod 755 /usr/local/bin/composer.phar
- Next, we need to let Bash know where to execute Composer:
Add this line below to bash_profile and save
alias composer="php /usr/local/bin/composer.phar"
- Finally, run:
If all goes well and it is working, you'll see this screen: