Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
install composer globally using mamp's PHP
Create an alias for our bash profile.
Within the terminal, run:
nano ~/.bash_profile
add the following line:
alias phpmamp='/Applications/MAMP/bin/php/php7.3.1/bin/php'
you must use the version of php you currently use with your mamp installation
run the following command in the terminal:
curl -sS | phpmamp
Note that instead of the standard 'php' , we are use 'phpmamp' to use the MAMP installation of PHP.
to make this available globally, so we need to move the file to '/usr/local/bin/composer'.
To do this, run the following command:
sudo mv composer.phar /usr/local/bin/composer
Terminal will ask you for yor password, after entering it and pressing the 'return' (or enter) key, you'll have a working global installation of composer on your mac that uses MAMP!
You can verify your installation worked by typing the following command:
that's it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.