ppmtojpeg: 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/ppmtojpeg - from package: netpbm-progs

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

On Debian possible default full paths are:

/usr/bin/ppmtojpeg - from package: netpbm

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