• Resolved anonymized-14293447

    (@anonymized-14293447)


    Hello anyone, I’m constantly getting an error on every update:
    ob_end_flush(): failed to send buffer of zlib output compression (0) in /…/wp-includes/functions.php on line 4979
    where the following is located:

    function wp_ob_end_flush_all() {
    	$levels = ob_get_level();
    	for ( $i = 0; $i < $levels; $i++ ) {
    		ob_end_flush();
    	}
    }

    Any suggestion to resolve it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    Thread Starter anonymized-14293447

    (@anonymized-14293447)

    …the tip is nailing the problem, but I wonder why I suddenly have the issue in my staging site and not in production. Isn’t there a solution that doesn’t do any core editing?

    Moderator bcworkz

    (@bcworkz)

    No core code need be altered. The proposed solution belongs in theme functions.php (preferably a child theme) or in a plugin. It’s not too difficult to create a simple plugin to contain any custom code you might have.
    https://developer.www.ads-software.com/plugins/plugin-basics/

    If your staging has an issue with its zlib compression, that would explain the discrepancy. The problem may not have revealed itself until code on your site had changed, by different theme, new plugin, code update, etc.

    Ludovic S. Clain

    (@ludovicsclain)

    Hi there,
    I have the same problem, my debug.log file says:
    [24-Nov-2021 11:03:27 UTC] PHP Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in ~/public_html/wp-includes/functions.php on line 5107
    I put this little snippet of KEVIN LEARY in the functions.php file of my child theme:

    remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
    add_action( 'shutdown', function() {
       while ( @ob_end_flush() );
    } );

    But the error still appears in my debug.log,
    Any idea on how I can fix it?
    Warm regards,
    Ludovic

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘error: failed to send buffer of zlib output’ is closed to new replies.