title: PHP XMLReader skips at large XML file
body: <p>I try to proceed a large xml file (about 1.5 GB) with about 3 million items with PHP XMLReader.
  But the script stops randomly between 2,3 and 2,6 million items without an error.</p>
  
  <p>There is no time or memory limit.</p>
  
  <pre><code>set_time_limit(0);
  ini_set('max_execution_time', 0);
  ini_set('memory_limit', -1);
  error_reporting(E_ALL);
  </code></pre>
  
  <p>This is the code:</p>
  
  <pre><code>$Reader = new XMLReader();
  $Reader-&gt;open('file.xml', NULL, LIBXML_PARSEHUGE);
  
  $count = 0;
  
  while ($Reader-&gt;read()) {
      if ($Reader-&gt;nodeType == XMLReader::ELEMENT &amp;&amp; $Reader-&gt;name == 'file') {
          $outerXml = $Reader-&gt;readOuterXml();
          $count ++;
          echo $count . "\r\n";
      }
  }
  
  echo 'end';
  </code></pre>
  
  <p>XMLReader seems to have some kind of restriction. I already tried the LIBXML_PARSEHUGE option but with no success.</p>
  
  <p>Anyone has an idea?</p>
  
  <p>Thanks!</p>
  
  <p>UPDATE:
  It seems to be a problem with http curl via SSH, even with --max-time option set.
  It works with when running directly through the PHP parser.</p>