Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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.

share|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!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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