I have installed XAMPP on Mac OSX running Yosemite
I have created the .bash_profile file like this:
export XAMPP_HOME=/Applications/XAMPP/xamppfiles
export PATH=${XAMPP_HOME}/bin/php:${PATH}
export PATH
When I type echo $PATH in terminal, I get correct XAMPP path
But when I type "which php" it shows /usr/bin/php
How can I make my XAMPP use the correct php instead of default php that came with mac?
解决方案
To use the XAMPP PHP and other binaries found in /Applications/XAMPP/bin/ by default this is the correct entry for ~/.bash_profile
export XAMPP_HOME=/Applications/XAMPP
export PATH=${XAMPP_HOME}/bin:${PATH}
export PATH
Load the changes with this (won't be needed next time you open a shell session):
source ~/.bash_profile
Confirm:
$ which php
/Applications/XAMPP/bin/php