title: Execute commands on remote machine via PHP
body: <p>To give background on my environment:</p>
  
  <p>I have 3 machines A, B &amp; C</p>
  
  <p>A = Webserver, running a php website which basically acts as an interface for B &amp; C</p>
  
  <p>B = Linux Ubuntu machine, i have root access, SSH and all the needed goodness to work on the machine via a SSH client (i have a .ppk private key file for this server)</p>
  
  <p>C = MySql Database server running on Linux</p>
  
  <p>I can successfully execute queries from A (php) on C (Mysql) and return the results. But now im trying to execute linux commands on B from A.</p>
  
  <p>Eg.</p>
  
  <p>I have a script thats running on B and would like to execute a command from A (php) to show the status of the script.</p>
  
  <p>In Command line to do this is easy - ./SomeScript status</p>
  
  <p>But i want to show the status of this script in the website im hosting on Server A.</p>
  
  <p>Even just check the uptime of Server B on Server A.</p>
  
  <p>Is this in anyway possible. i have googled forever as it seems but im not getting anywhere, Im not too phased if the connection is secure or not as this is a closed network with no outside access to this network.</p>
  
  <p>Any advise would be highly appreciated.</p>
  
  <p>Thanks</p>