Ago wrote:

It is not a database problem, it seems to me something about the reading of
the XML file. This is my code about this:


You can't rule out the database because, inserts are a resource intensive task.

$data = implode(file("example.xml"), "");


ouch!!

xml_parse_into_struct($parser, $data, &$structure, &$index);


you will be suckingup all the processor and memory with an operation like this. definitely not what you want to do with a web app. If you look at the sax parser examples in the php manual you will see how you can sequentially read in the data (and insert the data one at a time) instead of keeping the whole thing in memory.

xml_parser_free($parser);

it could be the array $data creation fails because the example.xml is too
big,

There you are.

infact if I decrease the size of xml file the script works (even if it
lasts several minutes),

There you are. You might even find that event driven SAX parser example i just refered to is a lot faster.

unfortunately the xml_parse_into_struct function
needs the $data array as argument.
My PHP version is 4.0.6.


--
Raditha Dissanayake.
---------------------------------------------
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to