Welcome! Log In Create A New Profile

Advanced

How to disable PHP output buffering

February 12, 2014 04:41AM
Hi,

I know this has been asked before, but I could not find a definitive answer. I tried different solutions, nothing worked.

I have a PHP script that has to do time intensive operations and provide a status update from time to time. No way around it.
I built a sample PHP script:
<?
@ini_set('zlib.output_compression',0);
@ini_set('implicit_flush',1);
@ob_end_clean();
ob_end_flush();
$i=0;
while($i<10)
{
echo "$i\n";
ob_flush();
flush();
sleep(1);
$i++;
}
?>

I have output_buffering = Off in php.ini

In nginx I have
location ~ \.php$
{
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;

gzip off;
proxy_buffering off;
fastcgi_keep_conn on;
fastcgi_buffers 128 1k; # up to 1k + 128 * 1k
fastcgi_max_temp_file_size 0;
fastcgi_buffer_size 1k;
fastcgi_buffering off;
}
(yeah, I put everything and the kitchen sink)

Server is Ubuntu 13.04, nginx 1.5.9, php 5.4.9

Any ideas?
Subject Author Posted

How to disable PHP output buffering

gaspy February 12, 2014 04:41AM

Re: How to disable PHP output buffering

Richard Stanway February 12, 2014 06:04AM

Re: How to disable PHP output buffering

Valentin V. Bartenev February 12, 2014 12:40PM

Re: How to disable PHP output buffering

gaspy February 12, 2014 03:37PM

Re: How to disable PHP output buffering

António P. P. Almeida February 12, 2014 04:38PM

Re: How to disable PHP output buffering

B.R. February 12, 2014 06:56PM

Re: How to disable PHP output buffering

gaspy February 13, 2014 01:20AM

Re[2]: How to disable PHP output buffering

artem February 13, 2014 01:54AM

Re: Re[2]: How to disable PHP output buffering

gaspy February 14, 2014 05:09AM

Re: How to disable PHP output buffering

gaspy February 13, 2014 01:19AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 86
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready