You are here: Re: Parsing XML File - PHP out of memory? « PHP Programming Language « IT news, forums, messages
Re: Parsing XML File - PHP out of memory?

Posted by Andy Hassall on 01/20/07 11:41

On 18 Jan 2007 06:32:14 -0800, bmichel@gmail.com wrote:

>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?

(1) Raise the PHP memory_limit parameter and/or max_execution_time (as posted
by others), depending on what error you get (you didn't post an error).

(2) Change the script to use less memory, e.g. by using a stream-based parser
such as expat - see http://php.net/xml - instead of loading the entire file
into memory then parsing it.

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация