Re: Parsing XML File - PHP out of memory?



bmichel@xxxxxxxxx wrote:

I tried modifying the value of the max_execution_time in my php.ini.
I also tried the set_time_limit() function.
Both ways no success...

I'm sure the script is not getting stuck somewhere, because I manually
divided the XML file into several files. And then, I ran the script for
each of those files and it worked.

Answer: It destroys the natural order of the conversation.
Question: Why is that?
Answer: Topposting
Question: What is the most annoying thing on usenet.


That aside, siply make some debugoutput in your script, and use ob_flush()
to make sure it reaches the browser before the timeout happens.

eg: During parsing, simply echo "Entering bla di bla with value XXX";

That way you can actually see if your script is doing what you think it is
doing.

Regards,
Erwin Moller



David Gillen wrote:
bmichel@xxxxxxxxx said:
Hey,

What I'm doing is the following:
- Load XML data a file
- Parsing the XML data
- Printing some parsed content

The problem is that the script execution is stopping before all the
content is parsed and printed.
Maybe the PHP is out of memory after a while. That would make sense
since the XML file is about 2 MB.

Someone has any ideas how I can solve this problem?

Check the max_execution_time in your php.ini
You can override it with set_time_limit(),
http://www.php.net/set_time_limit That'll allow your script to run for
longer, test on a smaller file to ensure your script isn't getting stuck
in a loop somewhere and is doing what it should.

D
--

.



Relevant Pages

  • Re: DOM-scripting -- FF problem
    ... A document can not be "served as XML"; ... If the document type was an XHTML document type, ... script code which would be necessary in order to achieve a Valid document ... markup characters are regarded literal characters without ...
    (comp.lang.javascript)
  • Re: WINDOWS MEDIA FILE EDITOR - HELP!!!
    ... before (You might want to look at programs like microsofts XML Notepad ... The actual file format can be defined by a DTD ... >but it is all our clients protocol supports) and with this, been encoding asf ... It doesn't recognize the same script file as I once used...get ...
    (microsoft.public.windowsmedia)
  • Re: WSH in VS.NET 2003?
    ... or will wsh xml include a ... Get the "TechNet Script Center Sample Scripts" ... Other|Useful Scripting Technologies|Saving Data in XML Format ... There is no schema for getting MS. ...
    (microsoft.public.scripting.wsh)
  • Re: Import XML from Command-Line into SQL
    ... Set objBL = CreateObject ... >I'd probably create a mapping schema and a VB Script ... that uses the SQL XML ...
    (microsoft.public.sqlserver.xml)
  • xml script
    ... Can anybody help me with this script. ... I have a script that read xml data, but i get a error in the For each ... ' Create an XML Document Object and specify XPath ... Dim oNode: Set oNode = oXDoc.selectSingleNode ...
    (microsoft.public.scripting.vbscript)