Ing.Martin prášek wrote:
> Hi..
> I have found a strange problem. I try to use php output buffering, but I found this 
> Working with small amount of data everything is fine. But If I set example script 
>like this:
> <?
> function callback($buffer)
>  {
>  return do_something_with($buffer);
>  }
> ob_start("callback")
> .
> .
> do_something_that_produce_big_output() // more than 1.5 MB
> .
> .
> .
> ob_end_flush();
> ?>
> Everything works fine when $buffer < approx 1.5 Mb, but if the size of the output, 
>that need to be bufered exceeded some strange limit aprox 1593400 bytes, buffer is 
>cut to that length and rest of the output is lost(!). I look in docs and manuals,  
>but found nothing about it. Is it posssible to set large size for the output 
>buffering operations or this strange limit is hard coded and cant be exceeded ???  I 
>try to play with PHP.INI or add swapspace and DIMs memory with no effect.....  Please 
> ---
> Odchozí zpráva neobsahuje viry.
> Zkontrolováno antivirovým systémem AVG (
> Verze: 6.0.381 / Virová báze: 214 - datum vydání: 2.8.2002


I don't think that should be considered a problem for PHP output 
buffering. Du you know ANY user that would that would wait for a 1.5MB 
page to display? And if you're transferring large binary files to the 
browser (a LARGE bitmap for example) you could get around this problem 
by doing

1. Open the file
2. Read a reasonable amount of data (say, 100000 bytes)
3. use ob_flush to sende the data to the browser
4. Repeat step 2 and 3 until all of file is read
5. Use ob_end_flush to send the rest of the buffer
6. Close the file

Hope this helps


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to