Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 6th, 2012  |  syntax: None  |  size: 1.64 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. unable to connect using SSH2
  2. 1           require("Net/SSH2.php");
  3. 2  
  4. 3           if (!class_exists('Net_SSH2')) die("Class Net_SSH2 doesn't exist!");
  5. 4          
  6. 5           $ssh = new Net_SSH2('***');   // the host IP address
  7. 6          
  8. 7           if (!method_exists($ssh, 'Net_SSH2')) die("Net_SSH2 class doesn't have Net_SSH2 method!");
  9. 8    
  10. 9           if (!$ssh->login('***', '***')) {   // (verified) username and password
  11. 10              echo "LOG: " . $ssh->getLog() . "<br>";
  12. 11              exit('Login failed!');
  13. 12          }
  14.        
  15. 1       require("Net/SSH2.php");
  16. 2
  17. 3       define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX);
  18. 4
  19. 5       if (!class_exists('Net_SSH2')) die("Class Net_SSH2 doesn't exist!");
  20. 6      
  21. 7       $ssh = new Net_SSH2('***');   // the host IP address
  22. 8      
  23. 9       if (!method_exists($ssh, 'Net_SSH2')) die("Net_SSH2 class doesn't have Net_SSH2 method!");
  24. 10
  25. 11      if (!$ssh->login('***', '***')) {   // (verified) username and password
  26. 12          echo "LOG: " . $ssh->getLog() . "<br>";
  27. 13          echo "ALL ERRORS: ";
  28. 14          print_r($ssh->getErrors());
  29. 15          echo "<br>LAST ERROR: " . $ssh->getLastError() . "<br>";
  30. 16          exit('Login failed!');
  31. 17      }
  32.        
  33. if (!class_exists('Net_SSH2')) die("Class Net_SSH2 doesn't exist!");
  34.        
  35. if (!method_exists($ssh, 'Net_SSH2')) die("Net_SSH2 class doesn't have Net_SSH2 method");
  36.        
  37. if( !class_exists('Net_SSH2')...
  38.        
  39. echo $ssh->getLog();
  40.        
  41. define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX);
  42.        
  43. error_reporting(E_USER_NOTICE);
  44.        
  45. error_reporting(E_USER_NOTICE);
  46.  
  47. user_error('zzzz', E_USER_NOTICE);
  48.        
  49. error_reporting(0);
  50.  
  51. user_error('zzzz', E_USER_NOTICE);