title: SFTP PHP 5.6 using phpseclib hangs
body: <p>I'm trying a simple example</p>
  
  <pre><code>$sftp = new phpseclib\Net\SFTP(FTP_ADDRESS);
  if (!$sftp-&gt;login(FTP_USER, FTP_PASS)) {
      $logger-&gt;error("FTP credentials error");
      $logger-&gt;error($sftp-&gt;getLastSFTPError());
  } else {
      $logger-&gt;log("Connection successful");
  }
  
    print_r($sftp-&gt;rawlist());
  </code></pre>
  
  <p>However the script just hangs and finally times out</p>
  
  <pre><code>( ! ) Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\XookCatalogFeed\lib\phpseclib\Net\SSH2.php on line 3186
  Call Stack
  #   Time    Memory  Function    Location
  1   0.2015  152184  {main}( )   ..\index.php:0
  2   0.2244  2275600 handle ( )  ..\index.php:95
  3   0.2246  2276880 {closure:C:\xampp\htdocs\XookCatalogFeed\handlers\import.php:157-285}( )    ..\index.php:95
  4   0.2254  2303944 phpseclib\Net\SFTP-&gt;login( )    ..\import.php:170
  5   5.1277  4457272 phpseclib\Net\SFTP-&gt;_send_sftp_packet( )    ..\SFTP.php:444
  6   5.1278  4457592 phpseclib\Net\SSH2-&gt;_send_channel_packet( ) ..\SFTP.php:2635
  7   30.0009 4457760 phpseclib\Net\SSH2-&gt;_send_binary_packet( )  ..\SSH2.php:3332 
  </code></pre>
  
  <p>I have tried a lot of stuff but nothing seems to work. I have done some debugging (step by step) it looks like the servers accepts thje credential but then the client just loops sending empty data at _send_binary_packet.</p>
  
  <p>Here is the log: <a href="https://gist.github.com/vlopez/2a48d261ab7713dbc06d" rel="nofollow">https://gist.github.com/vlopez/2a48d261ab7713dbc06d</a></p>
  
  <p>Someone, please help.</p>