First, Let’s find out what version of PHP we’re running (To find out if it’s the default version).
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
To do this, We need to edit the
.bash_profile and add the MAMP version of PHP to the PATH variable.
- 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).