Page 1 of 1

simplexml_load_file() and not releasing XML files

Posted: Fri Feb 26, 2010 5:11 am
by jeff00seattle
Hi

Sometimes I have a problem with simplexml_load_file() where it does not release its hold of an XML file after it is read.

In other words, after running a PHP program with simplexml_load_file() reading foo.xml, I cannot delete foo.xml because it is still being held by php.exe, and I am assuming the culprit is simplexml_load_file().

Is there a way to assure that simplexml_load_file() releases it hold on an XML file after I have completed traversing its generated tree of simple xml elements?

Thanks

Jeff in Seattle

Re: simplexml_load_file() and not releasing XML files

Posted: Fri Feb 26, 2010 9:44 am
by requinix
If unsetting the variable doesn't work, load the file into a string and load it from that.