Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save darkodemic/7576bfd27efd51ea6a30b9607e71ffeb to your computer and use it in GitHub Desktop.
Save darkodemic/7576bfd27efd51ea6a30b9607e71ffeb to your computer and use it in GitHub Desktop.
Disable zlib.output_compression on WordPress : Notice: ob_end_flush(): failed to send buffer of zlib output compression (1) in /path/wp-includes/functions.php on line 3282 via https://core.trac.wordpress.org/ticket/18525
SOLUTIONS I have came across so far:
======================== SOLUTION 1 ====================
In plugins (or somewhere) you probably have this code:
ini_set('zlib.output_compression', '1');
so, I replaced that code with
if (!is_admin()) ob_start('ob_gzhandler'); //because, in admin pages, it causes plugin installation freezing
and Compression will be remained still ON.
======================== SOLUTION 2 ====================
You may have to use:
remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment