Php 该网页仅显示部分ssh执行结果

Php 该网页仅显示部分ssh执行结果,php,ssh,phpseclib,Php,Ssh,Phpseclib,您好,我在一个会话中运行了几个ssh命令,这两个命令在命令提示符下执行并显示结果(第一个结果在一分钟后显示,第二个结果在一分钟后显示),但在我的网页上,它只显示了一半的结果,即第一次执行的结果和第二次执行的一小部分。有人能帮帮我吗? 这是我的密码: echo $ssh->read('username@username:~$'); $ssh->write("dis inter eth-trunk 3\n"); // note the "\n" $results= $ssh->re

您好,我在一个会话中运行了几个ssh命令,这两个命令在命令提示符下执行并显示结果(第一个结果在一分钟后显示,第二个结果在一分钟后显示),但在我的网页上,它只显示了一半的结果,即第一次执行的结果和第二次执行的一小部分。有人能帮帮我吗? 这是我的密码:

echo $ssh->read('username@username:~$');
$ssh->write("dis inter eth-trunk 3\n"); // note the "\n"
$results= $ssh->read('username@username:~$');

echo $results;
$myfile = fopen("data1.txt", "w") or die("Unable to open file!");
$txt = $results;
fwrite($myfile, $txt);
fclose($myfile);

echo $ssh->read('username@username:~$');
$ssh->write("dis inter eth-trunk 12\n"); // note the "\n"

$result= $ssh->read('username:~$');
echo $result;

我注意到在每个
$ssh->read()
调用中,您的提示都是不同的


我几乎想知道,对于您的第二次尝试,它是否在发送完整输出之前超时,此时执行
$ssh->setTimeout(30)
可能会起作用

我注意到在每个
$ssh->read()
调用中,您的提示都是不同的

我几乎想知道,对于您的第二次尝试,它是否在发送完整输出之前超时,此时执行
$ssh->setTimeout(30)
可能会起作用