Whats your memory_limit set to in php.ini - looks like 768MB from your error message.
You might want to set it to -1 which is no memory limit and see what happens.. Try phpinfo as well. Matt On Wed, Jan 7, 2009 at 1:10 PM, Michael <[email protected]> wrote: > > Now that I have the other problem fixed I want to revisit the issue of large > file handling - > > This is the code (placed within an array loop) - > ---------------------------------- > // Determine MIME type: > $mt=MIME_Type::autoDetect("$filename"); > > // If suitable MIME type open, read and process: > if (substr($mt,0,4) == "text") { > > // read the file: > $content = file_get_contents($filename,FILE_TEXT); > > // extract the information: > preg_match_all($pattern,$content,$matches); > > // add it to our array: > foreach($matches[0] as $m) $results[] = $m; > > // unset the temporary array: > unset($matches); > > // count valid file(s) scanned: > $pv = $pv + 1; > > }; // end the MIME type statement > ------------------------------------ > What is happening is that when I try and read a 1.9Gb text file, it fails, > with the following error message: > Scanning files: > Fatal error: Allowed memory size of 805306368 bytes exhausted (tried to > allocate 2023554020 bytes) in /www/scan.php on line 124 > > Now the fix is probably pretty straight forward - does anyone have any idea > please? > > Thanks in anticipation, > > Michael > > > > --~--~---------~--~----~------------~-------~--~----~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [email protected] -~----------~----~----~----~------~----~------~--~---
