Go to Terminal and open the bash_profile:
vi ~/.bash_profilePress "i" to insert and copy the following line to the bash_profile script (Make sure that the path matches your XAMPP installation):
export PATH=/Applications/XAMPP/xamppfiles/bin:$PATHCommit the current changes while pressing ESC and writing :wq + ENTER
To apply your changes to the current Terminal session, type:
source ~/.bash_profileor just close and open the Terminal again.