title: php ssh connection phpseclib
body: <p>System: Linux<br>
  Server: XAMPP<br>
  Goal:<br>
  ssh-connection to a server (later: doing some stuff on this server, not part of this question)</p>
  
  <p>Test-Code:</p>
  
  <pre><code> &lt;?php  
      set_include_path(get_include_path().PATH_SEPARATOR.'/home/myusername');
      include('Net/SSH2.php'); 
      $ssh = new Net_SSH2('123.45.6.78'); 
      if (!$ssh-&gt;login('user', 'password')) { 
      exit('Login Failed'); 
      }else{ 
      echo "connected".'&lt;br&gt;'; 
      echo $ssh-&gt;exec('whoami').'&lt;br&gt;';
      echo $ssh-&gt;exec('hostname')).'&lt;br&gt;';
      }   
      ?&gt;
  </code></pre>
  
  <p>Output:<br>
  <br>
      connected<br>
      (M4300-28G-PoE+) ><br>
      (M4300-28G-PoE+) ><br>
  <br>
  Problem:<br>
  I do not get any errors (neither in the output of the website (see above) nor in /opt/lampp/logs/error_logs), so:<br>
  Question(s):<br>
  Why am I not getting any output (user, hostname)? 
  Are there other/better ways to check whether I am properly connected? </p>