Fatal error: Allowed memory size exhausted...
- by Nano HE
HI, I upload my php testing script to online vps server just now. The script used to parse a big size XML file(about 4M, 7000Lines). But my IE explorer show the online error message below.
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 77 bytes) in /var/www/test/result/index.php on line 26
I am sure I already tested the php script on localhost successfully.
Is there any configuration need be enable/modify on my VPS? Such as php.ini or some setting for apache server? I just verified there are about 200M memory usage are avaliable for my VPS. How can I fix this?
......
function startElementHandler ($parser,$name,$attrib){
global $usercount;
global $userdata;
global $state; // Line #26;
//Debug
//print "name is: ".$name."\n";
switch ($name) {
case $name=="_ID" : {
$userdata[$usercount]["first"] = $attrib["FIRST"];
$userdata[$usercount]["last"] = $attrib["LAST"];
$userdata[$usercount]["nick"] = $attrib["NICK"];
$userdata[$usercount]["title"] = $attrib["TITLE"];
break;
}
......
default : {$state=$name;break;}
}
}