admin管理员组

文章数量:1345891

I am trying to run a SSH command from a PHP script using shell_exec or system:

system("ssh [email protected] remote_command");

which used to run fine until the most recent versions of PHP and Cygwin OpenSSH. Now it just hangs indefinitely.

I discovered that if I redirect the command to a file:

system("ssh [email protected] remote_command > output.txt");

The command completes and the output is redirected to the file.

I also did a clean install and in that instant it starts returning output and stalls halfway through.

本文标签: shellExecuting SSH using PHP shellexecsystem gives no output (hangs)Stack Overflow