PHP configuration option output_buffering must be disabled nextcloud 20.0.1 ubuntu

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

I have the same setting but the warning still appears.

1 Like

Comparto mi solución al error output_buffering.
Editar el archivo ‘apache2.conf’
Generar una copia de seguridad
cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf.copia
sudo nano /etc/apache2/apache2.conf
En la sección de “default security model” buscar(con nano Ctrl+w):
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted

Cambiar a →

<Directory /var/www/>
Options FollowSymLinks
AllowOverride All
Require all granted

Por ultimo reiniciar servicio, sudo service apache2 restart
Saludos!!

1 Like

English please

Go to /etc/php/8.0/apache2/php.ini search for output_buffering and either set it to 0 or Off i set mine to 0 then run sudo systemctl restart apache2

The .htaccess needs to be update to support the php 8 settings there’s already a pull request for this Update .htaccess (php8+ and mod_lsapi) by solracsf · Pull Request #26584 · nextcloud/server · GitHub

1 Like

This was the solution for me. In my main php.ini file, I searched for output_buffering, found it, set it to 0 (then ‘Off’, then back to 0) … double-checked all the other files – .htaccess, .user.ini … searched for additional overlooked php-ini files …etc …

Finally went back to my primary php.ini file, searched for output_buffering, found it, moved past the first instance and searched some more … found the 2nd setting, set that to 0, and all is good.

But … you know … WTF??? … why have the same GD flag twice in the same GD ini file??? ‘effin’ php.

And no, I/we did not “add a 2nd flag ourselves” and then forget about it. If I ever set that flag (to 4096), when I set it, it was the first such flag in the config file … and then later, I’m guessing with some php update, a 2nd commented-out flag got inserted before the active flag.

A year and a half later, upgrading to php 8.0, I just had the exact same experience again … set output_buffering to 0, then Off, then 0, then start searching all the other ini files … then run across my own damn comment explaining this … go back into my main php.ini (/etc/php/{php version number}/apache2/php.ini) … search for output_buffering in nano, find it, step one line past it and then search again … and voila … there’s the secret hidden second output_buffering flag that actually matters.

1 Like

Thank you. I did it only in /etc/php/7.x/cli/php.ini and missed out that it’s the apache2 one I had to change.

1 Like

How I fixed it:
Edit .htaccess to
php_flag “output_buffering” Off

then edit php.ini

Change to
; output_buffering = 4096
output_buffering = Off

sudo systemctl restart apache2

This may be a silly question, but I am kind of reluctant to turn off output buffering for the entire server just so nextcloud is happy.
Preferably, I would like to turn it off only for the nextcloud data directory. Is this possible?
For instance, if I keep the setting output_buffering = 4096 in my general php.ini but use output_buffering = 0 in .htacces and .user.ini, is this enough?
This is the configuration I currently have, and although this gives me the error “PHP configuration option output_buffering must be disabled” in the Admin overview, nextcloud still seems to work OK. So does this mean the setup is OK like this and I can ignore the error message?