simplexml_load_string(): Memory allocation failed

此生再无相见时 提交于 2020-04-18 00:51:44

问题


I have a problem, that when I try to load an XML-file (200MB), that I get the error-message:

simplexml_load_string(): Memory allocation failed

I tried it with smaller files (60 MB) and it works fine on them. I'm working on a windows-machine (+ xampp) if that is important. I already tried to use ini_set('memory_limit', '-1'); as well a 1024M as value. Could it be possible, that simplexml has a limit on how large the files can be?

I tried to look up this question on here, but the results are all concentrated on PHPExcel or similar.

PHP Warning: simplexml_load_string(): Memory allocation failed : building node in D:\xampp\htdocs\merger\index.php on line 11

while line 11 is simply:

$oldItems = simplexml_load_string($oldFile); // that's the 200MB file

I'm aware that there are probably smarter ways (like XSLT) to go for, but for now I'm stuck to simplexml. Any hints?

来源:https://stackoverflow.com/questions/60950500/simplexml-load-string-memory-allocation-failed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!