title: Can't read large XML file from PHP
body: <p>I have a huge XML file (114 KB/1719 lines; see the error message below why I say <em>huge</em>) and I try to read it as I have done with two similar files before.</p>
  
  <p>The other two files load normally and are of comparable size the only difference being that the file in question contains Arabic text. So here is the PHP code:</p>
  
  <pre><code>$doc3 = new DOMDocument('1.0', 'utf-8');
  $doc3-&gt;load($masternumber.'.xml');
  </code></pre>
  
  <p>And the error is:</p>
  
  <blockquote>
    <p>Warning: DOMDocument::load() [domdocument.load]: Excessive depth in document: 256 use XML_PARSE_HUGE option in file: ...</p>
  </blockquote>
  
  <p>Then <code>$doc3</code> doesn't load the file. So I modified the code:</p>
  
  <pre><code>$doc3-&gt;load($masternumber.'.xml', "LIBXML_PARSEHUGE");
  </code></pre>
  
  <p>And I end-up with another warrning:</p>
  
  <blockquote>
    <p>Warning: DOMDocument::load() expects parameter 2 to be long, string given in...</p>
  </blockquote>
  
  <p><code>$doc3</code> is empty again.</p>
  
  <p>What is wrong with it? The other files contain the same text in other languages and load properly but not this one? I am using PHP 5.3.9.</p>