0

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:

PATH=/Applications/MAMP/bin/php5/bin:\
/Applications/MAMP/Library/bin:$PATH
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.

swt83
  • 109
  • 1
  • 3

2 Answers2

0

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.

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
  • You can check what is being runned simply using mysql --version or php --version. Using .bashrc is more correct as already pointed out. –  Jul 28 '10 at 21:57
0

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