title: PHP SSH2 ssh2_connect
body: <p>So I have taken a example from php.net to see php ssh2 workings</p>
  
  <p>so the code is </p>
  
  <pre><code>&lt;?php
  $connection = ssh2_connect('shell.example.com', 22);
  
  if (ssh2_auth_password($connection, 'username', 'secret')) {
  echo "Authentication Successful!\n";
  } else {
  die('Authentication Failed...');
  }
  ?&gt;
  </code></pre>
  
  <p>When I am putting wrong information it is giving me some error instead of telling me Authentication Failed.</p>
  
  <p>The Error is</p>
  
  <pre><code>Warning: ssh2_connect(): php_network_getaddresses: getaddrinfo failed: Name not known in 
  /var/zpanel/hostdata/zadmin/public_html/whothehellcareswhatisthis/ssh2.php on line 2 Warning: ssh2_connect(): Unable to connect to 
  shell.example.com on port 22 in /var/zpanel/hostdata/zadmin/public_html/whothehellcareswhatisthis/login/ssh2.php on 
  line 2 Warning: ssh2_connect(): Unable to connect to shell.example.com in 
  /var/zpanel/hostdata/zadmin/public_html/whothehellcareswhatisthis/login/ssh2.php on line 2  Warning: 
  ssh2_auth_password() expects parameter 1 to be resource, boolean given in /var/zpanel/hostdata/zadmin/public_html/whothehellcareswhatisthis/login/ssh2.php 
  on line 4 Authentication Failed...
  </code></pre>
  
  <p>But when I am putting correct information it is not giving any error.</p>