Php – illegal command error code 127 in php exec function


I am using this php code:

exec("unrar e file.rar",$ret,$code);

and getting an error code of illegal command ie 127 … but when I am using this command through ssh its working … because unrar is installed on the server … so can anyone guess why exec is not doing the right stuff?

Best Solution

Try using the direct path of the application (/usr/bin/unrar of whatever), it sounds like php can't find the application.

Related Question