Hello,
I am trying to connect a unix server using ssh (phpseclib) and running an external program like 'C' program. I am using exec() to run .exe. My code looks this way
echo $ssh->exec('./demo.exe');
demo.exe is a executable for program to add two numbers and the inputs are hardcoded within the 'C' program.
This piece of code works perfectly when the inputs are hardcoded in the 'C' program. But when I try to pass the arguments to exec(), the php script becomes unresponsive. After modification to accept inuts for .exe, my code looks this way,
echo $ssh->exec("./demo.exe, '10 20'");
where demo.exe is a, executable for a simple program to add two numbers and 10 and 20 are inputs to the executable. I did modify the code as some of my friends suggested like
$ssh->exec("./demo.exe '10' '20'");
$ssh->exec("./demo.exe ; '10 20'");
$ssh->exec('./demo.exe 10 20');
but none of them worked. All the above php scripts became unresponsive. Could any one throw some light on this. Any inputs on this are greately appreciated.
Thanks in advance..