Page MenuHomePhabricator

tools: Disable the default PHP no-op output buffer
Closed, DeclinedPublic

Description

// http://php.net/ob_get_level
> ob_get_level()
int(1)
http://php.net/ob_get_status
> ob_get_status()
array(5) {
  ["level"]=>
  int(1)
  ["type"]=>
  int(1)
  ["status"]=>
  int(0)
  ["name"]=>
  string(22) "default output handler"
  ["del"]=>
  bool(true)
}

According to phpinfo(), zlib.output_compression = Off and output_handler = ''. That's good. But output_buffering = 4096 (silly PHP does this by default, it has an output buffer that you can't disable but doesn't do anything, either).

When using MediaWiki (or any other PHP app that tries to do the same) to send pages gzipped, it gives up because there is an ob level already, and of a type (internal php) that it claims it can't remove.

I ran into the same issue on my localhost, solved by setting:

output_buffering = Off

in php.ini

Please apply this to tools.wmflabs.org so that we can actually send out gzipped responses (especially important for tools that get called from popular gadgets with cross-domain JSON-P requests).

Details

Reference
bz55547

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:22 AM
bzimport added a project: Toolforge.
bzimport set Reference to bz55547.
yuvipanda subscribed.

I'm going to close this - the proxy sitting in front of everything already gzips things for you, your tool shouldn't be doing it.

Do re-open if this is still an issue that is causing other problems.

yuvipanda renamed this task from tools: Disable the default no-op output buffer to tools: Disable the default PHP no-op output buffer.Nov 27 2014, 10:16 PM
yuvipanda set Security to None.