title: Run command from different server using ssh2_exec() - php
body: <p>There are 2 servers (server A and server B). The server A will send a command and server B execute it.</p>
  
  <p>I had try the below code running from server A to instruct server B do a job and it work successful:</p>
  
  <pre><code>$connection = ssh2_connect('server.com', 22);
  ssh2_auth_password($connection, 'username', 'password');
  
  ssh2_exec($connection, 'mv /var/www/test.php /root');
  
  var_dump($connection);
  </code></pre>
  
  <p>from the above code, it will move test.php to the root folder. The problem happen if I try running the .sh file using the same code, it seems not running at all. Below is my example code to run .sh file</p>
  
  <pre><code>$connection = ssh2_connect('serverB.com', 22);
  ssh2_auth_password($connection, 'username', 'password');
  
  ssh2_exec($connection, './var/www/bbb_clean.sh');
  
  var_dump($connection);
  </code></pre>
  
  <p>If I run the bbb_clean.sh manually from the server B, it works . Please help me.</p>