ldapsearch: 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/ldapsearch - from package: openldap-clients
/usr/share/doc/perl-LDAP-0.40/bin/ldapsearch - from package: perl-LDAP

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

On Debian possible default full paths are:

/usr/bin/ldapsearch - from package: ldap-utils

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