https://unix.stackexchange.com/questions/276601/is-it-possible-to-add-a-single-executable-rather-than-an-entire-directory-to-m
Assuming that
echo "$PATH"
shows /usr/local/bin
in your path, and given that this is your personal laptop:
Create a symlink in
/usr/local/bin
that points to the executable you want.ln -s /Applications/XAMPP/xamppfiles/bin/php /usr/local/bin/php
If it is a shared computer and you don't want to affect other users, I recommend setting up a custom extension to your PATH in
~/.bash_profile
. I have one myself:$ grep PATH ~/.bash_profile
export PATH="$PATH:$HOME/.bin"