Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dospuntocero/95941beb334990c3ffd9cfc3fa613ff3 to your computer and use it in GitHub Desktop.
Save dospuntocero/95941beb334990c3ffd9cfc3fa613ff3 to your computer and use it in GitHub Desktop.
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 https://getcomposer.org/installer | 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:
composer
that's it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment