Problem reading large (>6MB) text files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Problem reading large (>6MB) text files

Post by daven »

I am trying to read apache's access_log, which is currently about 14MB. I have tried using file() and fopen()/fread(). Through experimentation with fread, I have discovered that I can read the file up to about 5930000 bytes [ie-- fread($fp,5930000)]. Anything larger than that, and I get a browser error message stating that "The file contains no data".

My configuration settings are as follows:
php.ini:
max_execution_time=900
memory_limit=32M

php 4.3.1
FreeBSD 4.3
apache 1.3.27

This worked previously, but it fails now. I have not changed the code, but my virtual host altered some settings.
Any ideas as to what might be happening?
cmkpl
Forum Newbie
Posts: 2
Joined: Fri May 30, 2003 8:30 pm

Post by cmkpl »

use while !EOF to seperate the process
Post Reply