我写了一些通过 ssh 连接到 vps 的 php 代码
我知道ssh2_exec
可以做到,但是如果我想运行许多命令,例如:
ssh2_exec($connection, 'cd /home/ubuntu/');
ssh2_exec($connection, 'mkdir folder');
ssh2_exec($connection, 'cd folder');
ssh2_exec($connection, 'touch test.txt');
.
.
.
它不起作用,只执行第一个命令。我怎样才能一起运行一些命令跟踪?