sphdistance: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/sphdistance - from package: GMT

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/lib/gmt/bin/sphdistance - from package: GMT

You may install the required package with command apt-get install {package}
Error in other languages:
sphdistance: bevel nie gevind nie
sphdistance: comandă negăsită
sphdistance: comando não encontrado
sphdistance: commande introuvable
sphdistance: command not found
sphdistance: käsku ei ole
sphdistance: không tìm thấy lệnh
sphdistance: komanda nerasta
sphdistance: Kommando nicht gefunden.
sphdistance: kommandot finns inte
sphdistance: komut yok
sphdistance: nie znaleziono polecenia
sphdistance: níor aimsíodh an t-ordú
sphdistance: no se encontró la orden
sphdistance: no s'ha trobat l'ordre
sphdistance: opdracht niet gevonden
sphdistance: parancs nem található
sphdistance: perintah tidak ditemukan
sphdistance: príkaz nenájdený
sphdistance: příkaz nenalezen
sphdistance: команда не найдена
sphdistance: командата не е открита
sphdistance: 命令找不到
sphdistance: コマンドが見つかりません