I want to execute shell script from my php application deployed on Red Hat linux server, I added this line to my application
exec("/app/sh/script.sh user server.info.com cmd.com 0 1 1" ,
$ret_string,
$ret_code);
the $ret_code is 2 I tried to run /app/sh/script.sh user server.info.com cmd.com 0 1 1 on the server, it works fine there is no problem.
The content of the script /app/sh/script.sh is
ssh -x [email protected] . /app/sh/pro.sh user PRO; $EXE/cmd.com 0 1 1;
I tried to run another script that return just a string from my application and it works, so I think the problem on the ssh connection.
Why the script script.sh work when I call it from the server directly and not work when I call it from the php application ?