title: SSH2 returning "resource(2) of type (stream)" (PHP)
body: <p>I'm attempting to run a SSH command from a remote server with PHP's <code>ssh2</code> library using the <code>ssh2_exec</code> function.</p>
  
  <p>Instead of getting what I want returned back to me from SSH, I get this:</p>
  
  <pre><code>resource(2) of type (stream)
  </code></pre>
  
  <p>Sometimes the <code>2</code> is a <code>3</code> if that matters.</p>
  
  <p>Here is the code that I'm attempting to use:</p>
  
  <pre><code>&lt;?php
  
  $connection = ssh2_connect('ssh.example.com', 22);
  
  ssh2_auth_password($connection, 'root', 'password');
  
  if($output = ssh2_exec($connection, 'uptime')) {
  
      var_dump($output);
  
  }
  </code></pre>
  
  <hr>
  
  <p><strong>Working solution</strong>:</p>
  
  <pre><code>&lt;?php
  
  $connection = ssh2_connect('ssh.example.com', 22);
  
  ssh2_auth_password($connection, 'root', 'password');
  
  if($output = ssh2_exec($connection, 'uptime')) {
  
      stream_set_blocking($output, true);
  
      echo stream_get_contents($output);
  
  }
  </code></pre>