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.
-
If you type
echo $PATHdoes it show the newPATH?I would suggest putting those lines in
~/.bashrcinstead since that is sourced for non-login interactive shells while~/.bash_profileis sourced for login shells.Gionn : You can check what is being runned simply using mysql --version or php --version. Using .bashrc is more correct as already pointed out.From Dennis Williamson
0 comments:
Post a Comment