I have a large xml file(around 50mb).I have tried many xml parsing codes but all give me memory error. I have even changed the memory limit to 256mb and above using ini_set command,but in vain. I need a memory efficient parser.Could you please help me.
If you are using a pre-written script you may find it is putting everything from the xml into an array. For an xml file this size that might be what's leading to your memory problem. Modify it to only store the data you need and see if that helps.
Also, try using a stream-oriented method this should be much more memory efficient. Use XML Parser in php, documentation can be found here: [uk.php.net ]