This question is an exact duplicate of:
I wrote some php code that connected to vps through ssh
I know ssh2_exec
can do it, but if I want run many command like:
ssh2_exec($connection, 'cd /home/ubuntu/');
ssh2_exec($connection, 'mkdir folder');
ssh2_exec($connection, 'cd folder');
ssh2_exec($connection, 'touch test.txt');
.
.
.
It doesn't work and only do first command. how can I run some many command trail together?
</div>