Welcome! Log In Create A New Profile

Advanced

Re: How to disable output buffering with PHP and nginx

All files from this thread

File Name File Size   Posted by Date  
nginx.conf 2.7 KB open | download B.R. 10/07/2013 Read message
test.php 77 bytes open | download B.R. 10/07/2013 Read message
php.ini 67.3 KB open | download B.R. 10/07/2013 Read message
nginx_php_backend.pcapng 5.5 KB open | download B.R. 10/07/2013 Read message
Maxim Dounin
October 07, 2013 07:20PM
Hello!

On Mon, Oct 07, 2013 at 03:22:15PM -0400, Ben Johnson wrote:

[...]

> Sorry to bump this topic, but I feel as though I have exhausted the
> available information on this subject.
>
> I'm pretty much in the same boat as Roger from
> http://stackoverflow.com/questions/4870697/php-flush-that-works-even-in-nginx
> . I have tried all of the suggestions mentioned and still cannot disable
> output buffering in PHP scripts that are called via nginx.
>
> I have ensured that:
>
> 1.) output_buffering = "Off" in effective php.ini.
>
> 2.) zlib.output_compression = "Off" in effective php.ini.
>
> 3.) implicit_flush = "On" in effective php.ini.
>
> 4.) "gzip off" in nginx.conf.
>
> 5.) "fastcgi_keep_conn on" in nginx.conf.
>
> 6.) "proxy_buffering off" in nginx.conf.

Just a side note: proxy_buffering is unrelated to fastcgi,
switching if off does nothing as long as you use fastcgi_pass.

> nginx 1.5.2 (Windows)
> PHP 5.4.8 Thread-Safe
> Server API: CGI/FastCGI
>
> Is there something else that I've overlooked?
>
> Perhaps there is someone with a few moments free time who would be
> willing to give this a shot on his own system. This seems "pretty
> basic", but is proving to be a real challenge.

There are lots of possible places where data can be buffered for
various reasons, e.g. postpone_output (see
http://nginx.org/r/postpone_output). In your configuration you
seems to disable gzip filter - but there are other filter which
may buffer data as well, such as SSI and sub filters, and likely
many 3rd party modules.

While it should be possible to carefully configure nginx to avoid
all places where buffering can happen, it should be much easier to
use

fastcgi_buffering off;

as available in nginx 1.5.6, see
http://nginx.org/r/fastcgi_buffering.

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to disable output buffering with PHP and nginx

Ben Johnson September 16, 2013 01:22PM

Re: How to disable output buffering with PHP and nginx

Ben Johnson October 07, 2013 03:24PM

Re: How to disable output buffering with PHP and nginx

itpp2012 October 07, 2013 04:25PM

Re: How to disable output buffering with PHP and nginx

Francis Daly October 07, 2013 05:36PM

Re: How to disable output buffering with PHP and nginx

B.R. October 07, 2013 06:00PM

Re: How to disable output buffering with PHP and nginx

Maxim Dounin October 07, 2013 07:20PM

Re: How to disable output buffering with PHP and nginx Attachments

B.R. October 07, 2013 11:00PM

Re: How to disable output buffering with PHP and nginx

Maxim Dounin October 08, 2013 11:50AM

Re: How to disable output buffering with PHP and nginx

Ben Johnson October 10, 2013 11:14AM

Re: How to disable output buffering with PHP and nginx

Maxim Dounin October 10, 2013 11:28AM

Re: How to disable output buffering with PHP and nginx

Ben Johnson October 10, 2013 12:50PM

Re: How to disable output buffering with PHP and nginx

itpp2012 October 10, 2013 01:35PM

Re: How to disable output buffering with PHP and nginx

Maxim Dounin October 10, 2013 02:26PM

Re: How to disable output buffering with PHP and nginx

Ben Johnson October 12, 2013 04:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 86
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready