Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. ini_set('include_path', '/usr/local/lib/custom_php/phpseclib');
  2. include('Net/SSH2.php');
  3. include('Net/SFTP.php');
  4. define('NET_SFTP_LOGGING', NET_SFTP_LOG_COMPLEX);
  5.  
  6.  
  7.  
  8. $username = "user";
  9. $password = "password";
  10. $host = "ftp.the3rdpartyserver.com";
  11.  
  12.  
  13.  
  14. $sftp = new Net_SFTP($host);
  15. $sftp->setTimeout(1000);
  16. $sftp->fsock = 1000;
  17. if (!$sftp->login($username, $password)) {
  18. exit('login failed again');
  19. };
  20.  
  21. //$sftp->put($remote_file, $local_file, NET_SFTP_LOCAL_FILE);
  22. //$sftp->put($remote_file, "imagetemp.png", NET_SFTP_LOCAL_FILE);
  23. $sftp->put('filename.txt', "xxx");
  24.  
  25. print_r($sftp->getSFTPErrors());
  26. echo $sftp->getSFTPLog();
  27.  
  28. Error 110. Connection timed out in <b>/usr/local/lib/custom_php/phpseclib/Net/SSH2.php</b> on line <b>966</b><br /> login failed again<br /> <b>Notice</b>: Connection closed prematurely in <b>/usr/local/lib/custom_php/phpseclib/Net/SSH2.php</b> on line <b>3143</b><br /> <br /> <b>Warning</b>: fclose() expects parameter 1 to be resource, boolean given in <b>/usr/local/lib/custom_php/phpseclib/Net/SSH2.php</b> on line <b>3379</b><br />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement