0

I have XML file with <xi:include, loading as:

$datas = new SimpleXMLElement( file_get_contents( "data.xml" ) );

$dom = dom_import_simplexml($datas);
$dom->ownerDocument->xinclude();

When I run the script only those <xi:include without errors get loaded/parsed.

On a different machine the parser is able to process main XML and all includes. In the case of errors in <xi:include it spits them out together with their location. This helps in debugging.

This looks like config issue but can't locate in php.ini when to correct it.

Any idea?

Thanks.

Mugoma J. Okomba
  • 3,185
  • 1
  • 26
  • 37
  • `display_errors`? Maybe `xdebug` is activated. Take a look. – Felippe Duarte May 16 '16 at 20:48
  • @FelippeDuarte I can't see an entry for `xdebug` in php.ini, but I am able to see errors if they appear in main XML. Would `xdebug` (if activated/deactivated) make the parser check/ignore errors in `xinclude`? – Mugoma J. Okomba May 17 '16 at 02:02
  • Have a look at the `phpinfo()` output on the two machines (remember not to leave it publically accessible) - are they a different version of PHP? Do they use a different version of libxml2 (which underlies the SimpleXML and DOM) extensions? Are any of the XML-related ini settings different? Are `error_reporting` and `display_errors` set appropriately? – IMSoP May 17 '16 at 09:06
  • @IMSoP the 2 machines have different versions of PHP. Old one (working) has PHP 5.4 while new one (faulty) has PHP 5.6. Their libxml2 versions is also different. 2nd difference is old one runs on Windows while new one runs on Linux. Last difference is binaries for old one are downloaded while new one I compiled myself. I didn't notice any difference in .ini settings nor error reporting. Note that the new one (faulty) still outputs errors if they occur in main XML. So, error reporting doesn't seem to be an issue. – Mugoma J. Okomba May 17 '16 at 11:55
  • It might be useful to [edit] the question to include that information, including the exact versions of PHP and libxml on each machine. If you can provide some sample XML that reproduces the problem and [edit] that in, that would be good as well. – IMSoP May 17 '16 at 12:30

0 Answers0