You are here: Re: PHP parser XML « PHP Language « IT news, forums, messages
Re: PHP parser XML

Posted by Christoph Burschka on 05/25/07 06:28

CK schrieb:
> Hello Folks,
> My environment is : FreeBSD 6 , apache 1.3.7 and PHP5
> I want to parse a big XML file (39MB) . In my php.ini I set memory_limit to
> 64M but I still have a error message followed :
> Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to
> allocate 57 bytes) ...
>
> Your helps would be appreciated .
> Thanks
>
> CK

The parsing process likely requires more memory than just the size of
the file. I've had similar problems when reading or processing other
files that were significantly above half the memory limit.

You could try to optimize the memory usage - perhaps split the file up
in chunks in temp files and process them one at a time, rather than read
the entire file into memory. Not all XML files can be split like this,
but those that have a long list of identical entities in series (say, an
RSS feed with hundreds of items) can be. You'd just need to add the
opening and closing tags to each chunk.

--
cb

 

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

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