最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

shell - Executing SSH using PHP shell_exec, system gives no output (hangs) - Stack Overflow

programmeradmin3浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论