Red Hat Bugzilla – Bug 298031
PHP DOM XML (libxml) suddenly fails to read files
Last modified: 2008-05-21 10:31:43 EDT
Description of problem:
PHP suddenly fails to read remote and local files through libxml. The behaviour
is erratic. It has happened twice. Then after a while everything suddenly works
as expected again.
Version-Release number of selected component (if applicable):
$doc = new DOMDocument();
Steps to Reproduce:
This is a tough one since it's erratic. The problem persisted after restarting
apache and rebooting the entire system. Then the problem went away without me
1. Run Soap webservices and Soap clients
2. Read local files through DOM XML.
Warning: DOMDocument::load(): supplied argument is not a valid Stream-Context
display the XML.
The following form thread describes the same problem:
It also has an answer to the problem. However I couldn't find specifics about
"This problem is fixed in 5.2. When using libxml_set_streams_context, the
context was never destroyed for the process when the request terminated so would
remain for every request made within the process. As far as ext/soap goes, it
can create an xml stream context when needed. It does look like there is a case
within the code that it could error out (extra-ordinary circumstance) and
ext/soap does not reset the context back to its original state (needs to be fixed).
If this is a continual issue for you, upgrade to 5.2 (where the context is reset
at the end of every request) or make sure you manually reset the xml context
(using the method you are currently using) before your script terminates.
It's a little tricky to work out exactly what fix upstream this corresponds to;
can you try out the test packages from here:
(note, untested by Red Hat QA, no warranty, etc!)
Hi Joe, thank you for the response. We could install those packages. However we
have no way to test them since we're still unsure what triggered the bug and
unable to reproduce the situation. I'll discuss here and get back on it.
We did learn later that there was a IPv6 malfunction on the network that day. I
suspect this somehow triggered something in our SOAP requests, messing up the
entire PHP stream context.
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release. Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products. This request is not yet committed for inclusion in an Update
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.