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 P
Finally I Solve the Problem. I set the Following Config in my "~/.bash_profile"
If u have a bash_profile U need to Edit otherWise create bash_profile. Then Add these lines 1st
export PATH=/Applications/XAMPP/xamppfiles/bin:$PATH
export PATH
Above is the Xampp path. Next Add The Composer Path(IF U ADD THE COMPOSER PATH 1st IT WON'T WORK)
export PATH="~/.composer/vendor/bin:$PATH"
Finally Working Fine for Me.
which php
/Applications/XAMPP/xamppfiles/bin/php