Re: What's wrong with this code?

From: Date: Mon, 23 Apr 2001 07:43:46 +0000
Subject: Re: What's wrong with this code?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-49815@lists.php.net to get a copy of this message
I haven't got any experiences with it, but the fread function will probably be your problem.. As far as I can see you try to read 24 Megabyte into a var... This is quite large, and probably your script will be quite because of memory problem, or a OS don't won't allow you to use that much memory for the process.. What solution you will have to use I don't know, problaby read blocks of 500 kilobyte process it and then reuse the variable to read the next 500 kilobyte etc etc till you are finished.. Bye Bye David > $file = fopen("includes/about.inc", "r"); > $data = fread($file, 24000000); > $stripped = stripslashes($data); > $formatted_data = nl2br($stripped); > echo "$formatted_data"; > > Any ideas why that doesn't work on one server but it will work on another > server? The server it works on is Win2k, IIS5, php4.0.4pl1. The server it > doesn't work on is Linux, Apache, php4.0.4pl1. Any ideas why this won't > work? Just to be sure, I did a chmod 777 about.inc, so file permissions > isn't it. > > Thanks everyone, > Tyler Longren > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#49815) next »