PHP configuration option output_buffering must be disabled nextcloud 20.0.1 ubuntu

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 acsfer · 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?