I have MAMP installed on my Mac for use as a localhost development environment. Previously, I used the already-installed PHP and my own install of MySQL, but I want to move to MAMP because I think it'll make things easier in the long run.

My question is on using the command line interface, and wanting my command line to use MAMP's version of PHP and MySQL instead of what I originally had installed. I created a new file in my home directory called .bash_profile and I added this:

export PATH

Now when I open Terminal and type "which mysql" I get a result that it's using MAMP, good. But when I type "which php" it's still using the original OSX version instead of MAMP. What can I do to fix this?

Thanks much.


If you type echo $PATH does it show the new PATH?

I would suggest putting those lines in ~/.bashrc instead since that is sourced for non-login interactive shells while ~/.bash_profile is sourced for login shells.

| improve this answer | |
  • You can check what is being runned simply using mysql --version or php --version. Using .bashrc is more correct as already pointed out. – user29686 Jul 28 '10 at 21:57

Using MAMP 1.9.1, I did a chmod 755 /Applications/MAMP/bin/php5.2/bin/php and now it works!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.