title: fopen via ssh doesn't retrieve the entire file
body: <p>I have to open a file with fopen and read the entire content.
  The file is accessible through a ssh-sftp connection:</p>
  
  <p>Here is my code to connect, open and read the file:</p>
  
  <pre><code>//ssh connection
  $connection = ssh2_connect($host, $port);
  //open the file
  $handle = fopen("ssh2.sftp://$sftp".$file, "r");
  $out = array();
  //read the file
  while (($fields = fgetcsv($handle, 0, ";")) !== FALSE) {
     $out[]=$fields;
  }
  </code></pre>
  
  <p>The file is actually a csv one. With fgetcsv I read the file row by row.
  But even if my file has let's say 50 rows after about 20 rows the fgetcsv fails and my final out array is incomplete.
  The file is actually local on my machine: if opened through ssh only the first 20 rows are read, if opened normally with a direct file system path:</p>
  
  <pre><code>fopen("localpath", "r");
  </code></pre>
  
  <p>The while loop reads all the 50 rows.</p>
  
  <p>Is there any limit in bytes when reading from a ssh connection? Can this limit be changed with a php.ini configuration option?</p>