PHP configuration option output_buffering must be disabled nextcloud 20.0.1 ubuntu

Hi I have an issue wich an erorr message I am getting please see below

Thanks

Nextcloud version (eg, 18.0.2): 20.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-52-generic x86_64
Apache or nginx version (eg, Apache 2.4.25): Apache Server version: Apache/2.4.41 (Ubuntu)
Server built: 2020-08-12T19:46:17

PHP version (eg, 7.1): 7.4

The issue you are facing:

Hi, getting the following error in nextcloud:

PHP configuration option output_buffering must be disabled

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Overview in nextcloud admin interface

Strange this is:

output_buffering is set to 0 everywhere

php.ini
.htaccess
.user.ini

The output of your Nextcloud log in Admin > Logging:

Error: Undefined offset: 3 at /var/www/nextcloud/lib/private/legacy/OC_Helper.php#548
(repeats very often I think it is fixed in the next release)

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "FQDN goes here",
        "192.168.111.120"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "20.0.1.1",
    "overwrite.cli.url": "https:\/\/FQDN goes here",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "updater.release.channel": "beta",
    "mail_smtpmode": "smtp",
    "mail_smtpsecure": "ssl",
    "mail_sendmailmode": "smtp",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauth": 1,
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "465",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauthtype": "LOGIN",
    "updater.secret": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "theme": "",
    "loglevel": 2
}
1 Like

This problem is being described in the Nextcloud administrator guide where you find information how to fix the problem:

Yes I have looked at that guide and followed exactly all settings as described in my original post…the problem still exists

Hi, sorry not to be of assistance, but I too have the same issue with NC 20.0.1 running on OpenSUSE.

As workaround use output_buffering = Off until the code is fixed or ignore the warning.

Well guess what I have tried …read above and no didn’t fix it …hopefully it will be fixed!

All, I really appreciate help here but pointing me to an admin manual is NOT the solution…I have entered everything according to the manual see above! Thanks

1 Like

Use Off until the code is fixed to also accept 0, False or No as value.

I have used off didn‘t work

With a big O :wink: If that does not work output_buffering is enabled or something else is broken.

I did ! This is UNIX land of course

; output_buffering
; Default Value: Off
; Development Value: 4096
; Production Value: 4096

output_buffering = Off

in php.ini

Didn’t work

Cheers

I have the same problem:
output_buffering = 0
OR
output_buffering = Off

does not fix the error: PHP configuration option output_buffering must be disabled

1 Like

I think the current approach is correct and something on your setup is broken. A first start to validate that is to create a file in nextcloud’s folder info.php with

<?php

phpinfo();

open it in your browser and look for output_buffering.

<?php

phpinfo();

open it in your browser and look for output_buffering.

This worked for me. When I looked for output_buffering it was indeed set to a number. I did a search in my php.ini and found that in one area I had it commented out with the default value being off. But when I searched further I saw that output_buffering was set to 4096 further down in my php.ini. I think I did this before, but forgot about it. Once I commented out the line, the error was gone.

So the moral of the story is that I had two different output_buffering settings in my php.ini

Also make sure your editing the correct php.ini. At the top of the phpinfo.php web page is what the file location of the correct php.ini in use is.

1 Like

ok thanks for all the hints…there was a second line somewhere who did overwrite the value :frowning: and I didn’t see it god knows why…fixed now

Hi, I have same problem with “output_buffering”. I’ve installed NC in a shared hosting and i’m not able to edit the php.ini file. I’ve tried adding: output_buffering=Off, It didn’t work. I modified .htaccess and the .user.ini

NOTE: I changed the value of output_buffering to False, 0, No and Off but the error persist…

Could you help me ? Please

I could solve this error:

I’ve used php_flag instead of php_value

#php_value output_buffering …
php_flag output_buffering Off

When I go to the updater option (Configuration -> Administration -> General setting -> Open updater), NC redirect to dashboard but I have instaled the 20.0.0 version and the 20.0.2 version is available. I’m not sure if it is related…

1 Like

I set php_flag “output_buffering” Off in /etc/php/7.4/apache2/php.ini fixed.

1 Like

Is not a valid syntax for php.ini. You can use this syntax if you run php as apache module in your vhost configuration / htaccess file: https://www.php.net/manual/en/configuration.changes.php

I had the same issue.
I changed value in /var/www/nextcloud/.user.ini and it works

Here is my user.ini file :

mbstring.func_overload=0
always_populate_raw_post_data=-1
default_charset='UTF-8'
output_buffering=0
2 Likes