PHP/SSH:如果他们满足多个页面,则如何输出(回声)SSH结果?
我尝试通过SSH连接到设备(在我的情况下是华为交换机),在网页上执行命令和打印结果。 如果我的$ ssh_input等于'display arp | i 10.100.1.1'我将在网页上取得下一个结果,并且在网页上相同的结果 - 都可以正常工作。
但是,当我尝试做$ ssh_input时I 10.100' - 结果在终端中变成了多个页面,我可以按“空间”下一页。
但是在网页上,此情况无限加载页面,因为据我了解,据我了解,众所周知,代码未完成
$connection = ssh2_connect($ip, 22);
ssh2_auth_password($connection, 'login', 'password');
$stream = ssh2_exec($connection, $ssh_input);
stream_set_blocking($stream, true);
$stream_out = ssh2_fetch_stream( $stream, SSH2_STREAM_STDIO );
echo "<pre>";
echo stream_get_contents($stream_out);
echo "</pre>";
我如何通过多个页面修改代码以进行输出?
I am try connect by SSH to device (in my case Huawei switch), execute command and print result on web page.
If my $ssh_input equal like 'display arp | i 10.100.1.1' i have next result in terminal and same result on web page - all work fine.
But when I try do $ssh_input equal like 'display arp | i 10.100' - result became with multiple page in terminal and i can press 'Space' next page.
But on web page this case result infinite load of page because, as I understand, code don't complete
$connection = ssh2_connect($ip, 22);
ssh2_auth_password($connection, 'login', 'password');
$stream = ssh2_exec($connection, $ssh_input);
stream_set_blocking($stream, true);
$stream_out = ssh2_fetch_stream( $stream, SSH2_STREAM_STDIO );
echo "<pre>";
echo stream_get_contents($stream_out);
echo "</pre>";
How I can modify my code for output that case with multiple page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论