Jump to content

Reading from an extremely large file in php


blakekr

Recommended Posts

I have a very long server log file I want to parse with php, but it requires too much memory (I thought) to put it into an array. It turns out, it's requiring too much memory even to open and go through line-by-line, or so it seems ... I get this error ...

 

 

if (!($fp = fopen("$ac_arr", 'r')) ) {

  die('Cannot open file');

}

....

> FATAL:  emalloc():  Unable to allocate -2147483648 bytes

 

Is there any of "getting at" and parsing a very long file of this size, or do I just have to delete it?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.