LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > PHP > defeat buffered output in PHP for realtime display?

Reply
 
Thread Tools Display Modes
  #1  
Old 05-02-2008, 08:10 AM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
Question defeat buffered output in PHP for realtime display?

Some of the tricks I try to use in PHP to typically defeat the output buffering to diagnose the output of long scripts does not seem to be working with LiteSpeed.

I suspect this is because LiteSpeed tries to gather the output so it can compress+chunk it (typically in 4k blocks).

Is there any trick I can use to defeat the buffer effect on a per-script basis?

None of these solve the problem:
ini_set('output_buffering', 0);
ini_set('implicit_flush', 1);
ob_end_flush();

Last edited by aww; 05-02-2008 at 08:17 AM..
Reply With Quote
  #2  
Old 05-02-2008, 08:19 AM
aww aww is offline
Senior Member
 
Join Date: May 2007
Posts: 237
It took a bit of googling but I found the answer that works on apache and I believe it works on LiteSpeed as well:

after each echo, or other output, put a:
ob_flush(); flush();

(I had only put ob_flush(); )
Reply With Quote
  #3  
Old 10-24-2012, 05:48 PM
Mitch Mitch is offline
New Member
 
Join Date: Oct 2012
Posts: 4
Hi there.

Sorry to bump a 4 year old thread but I couldn't find a more relevant thread and I'm having the same issues.

No matter what variations of code I use I'm not able to flush the output buffer

ie.

PHP Code:
ini_set('output_buffering'0); 
ini_set('implicit_flush'1);
ob_end_flush();

for(
$i=0$i<10$i++){
    echo 
$i;
    
sleep(1);
    
ob_flush();
    
flush();

Has anyone else been able to successfully flush(); ?
Reply With Quote
  #4  
Old 10-24-2012, 05:59 PM
Mitch Mitch is offline
New Member
 
Join Date: Oct 2012
Posts: 4
Please note that I've disabled gzip compression (and dynamic compress) on litespeed and it's made no difference
Reply With Quote
  #5  
Old 10-24-2012, 06:59 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,291
what's your lsphp5 settings?

check

Server->External App->lsphp5
Reply With Quote
  #6  
Old 10-25-2012, 10:16 PM
Mitch Mitch is offline
New Member
 
Join Date: Oct 2012
Posts: 4
Quote:
Originally Posted by NiteWave View Post
what's your lsphp5 settings?
Specifically which settings?
Reply With Quote
  #7  
Old 10-25-2012, 10:19 PM
Mitch Mitch is offline
New Member
 
Join Date: Oct 2012
Posts: 4
Persistant Connection is on, Instances is set to 1, Response Buffering is set to No.

Is Response Buffering the issue here?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:58 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.