blakekr Posted February 3, 2007 Share Posted February 3, 2007 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? Link to comment https://forums.phpfreaks.com/topic/36956-reading-from-an-extremely-large-file-in-php/ Share on other sites More sharing options...
mattd8752 Posted February 3, 2007 Share Posted February 3, 2007 You can probably manually split it. Or PEARL can open a lot bigger files (I believe, I may be completely wrong). Link to comment https://forums.phpfreaks.com/topic/36956-reading-from-an-extremely-large-file-in-php/#findComment-176358 Share on other sites More sharing options...
kenrbnsn Posted February 4, 2007 Share Posted February 4, 2007 That error doesn't look like it's coming from the open. Please post the code you're using to process the file. Ken Link to comment https://forums.phpfreaks.com/topic/36956-reading-from-an-extremely-large-file-in-php/#findComment-176514 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.