[英]PHP Net_SSH2 returning inconsistent output
I was wondering if anyone has had this problem or maybe have an idea of what could be causing my problem 我想知道是否有人遇到了这个问题,或者对导致我的问题的原因有所了解
After executing the following lines of code... 执行以下代码行后...
$ssh2->write("uptime\n");
$out = $ssh2->read($prompt, NET_SSH2_READ_REGEX);
I am sometime getting all the output i expect from the command and sometime only getting half, or even less. 我有时会从命令获得所有期望的输出,有时只会得到一半甚至更少。 I'm not sure why this is happening. 我不确定为什么会这样。 Possible buffer/stream issue? 可能存在缓冲区/流问题? I read somewhere about not being able to read >1000 lines... 我在某处读到无法读取> 1000行...
Any help would be appreciated. 任何帮助,将不胜感激。 Should i be using exec() instead? 我应该改用exec()吗?
Thanks 谢谢
It seems my prompt was causing the issue of intermittent output length. 似乎我的提示引起了间歇输出长度的问题。 Weird, because i thought it would be cutting short at consistent points. 很奇怪,因为我认为这样做会缩短一致性点。 Oh well. 那好吧。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.