【发布时间】:2018-02-06 19:02:51
【问题描述】:
我正在使用 ssh2_exec 运行命令,但看起来它在 $stream1 进程结束之前运行 $stream2。如何仅在 $stream1 结束后运行 $stream2?
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$stream1= ssh2_exec($connection, 'command to run');
$stream2 = ssh2_exec($connection, 'command to run 2');
?>
【问题讨论】: