Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management
Instructions to Change PHP Installation
First, Lets find out what version of PHP we're running (To find out if it's the default version).
To do that, Within the terminal, Fire this command:
This should output the path to the default PHP install which comes preinstalled by Mac OS X, by default it has to be (Assuming you've not changed it before):
Now, We just need to swap this over to the PHP that is installed with MAMP, which is located at
/Applications/MAMP/bin/php/php5.4.10/bin (MAMP 2.1.3)
To do this, We need to edit the
.bash_profile and add the MAMP version of PHP to the PATH variable.
Follow these simple steps:
Within the Terminal, run
iand then paste the following at the top of the file:
:wq, and hit
In Terminal, run
In Terminal, type in
which phpagain and look for the updated string. If everything was successful, It should output the new path to MAMP PHP install.
In case it doesn't output the correct path, try closing the terminal window (exit fully) and open again, it should apply the changes (Restart in short).
Install Composer Package Management
Now you can fire the command to install the composer globally (So you can access it from anywhere):
$ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
You can verify your installation worked by typing the following command within the Terminal:
It'll show you the current version and a list of commands you can use if the installation was successful.