pydio-core icon indicating copy to clipboard operation
pydio-core copied to clipboard

Pydio Diagnostic Tool fails to detect PHP output_buffering value, reports erroneous warning

Open cbj4074 opened this issue 7 years ago • 4 comments

Prior to installation, phpinfo() reports that output_buffering is set to 0, but the Pydio Diagnostic tool reports a warning:

You should disable php output_buffering parameter for better performances with Pydio.

I've triple-checked that the configured value is correct. Is it possible that the Tool caches its results, or is checking for false when other empty() values should be considered, too?

cbj4074 avatar Sep 12 '17 20:09 cbj4074

The problem appears to be here:

https://github.com/pydio/pydio-core/blob/develop/core/src/core/src/pydio/Tests/PHP_OB.php#L44

The value in the effective php.ini is as follows:

output_buffering = Off

If I var_dump($v);exit; before the line cited above, the output is

string(1) "0"

PHP Version 7.1.9 running via php-fpm

cbj4074 avatar Sep 12 '17 20:09 cbj4074

can you maybe submit a PR to fix that?

cdujeu avatar Sep 13 '17 07:09 cdujeu

I'm happy to submit one. I just signed the CLA. While somewhat of a "barrier to entry" (I have to give my name, address, telephone number, email, etc.), the requirement seems wise!

Regarding the Issue at hand, I'm not entirely certain what range of values should be considered to constitute output-buffering being off/disabled...

The default is "0" (a string with the number zero), and the return-types, according to http://php.net/manual/en/outcontrol.configuration.php#ini.output-buffering , are boolean/integer.

Humorously, the default seems to be neither a boolean nor an integer (it's a string, according to the same document).

I'm curious how much value resides in checking !isSet(ini_get("output_buffering")). It seems as though output-buffering is a problem only if an integer value is returned.

I'd love to hear your thoughts before I submit a PR. Thanks in advance!

cbj4074 avatar Sep 14 '17 00:09 cbj4074

hi, what about change the line to if (isSet($v) && ( (is_numeric($v) && $v != "0") || strtolower($v) == "on")) { ?

cdujeu avatar Oct 05 '17 09:10 cdujeu