plugins – ob_end_flush(): failed to send buffer of zlib output compression (0) in external php

Question

I have this little php I call from jqGrid url that I use inside an admin’s wordpress plugin:

require_once($_SERVER['DOCUMENT_ROOT'] . '/xDl21my20/wp-load.php');
remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
add_action( 'shutdown', function() {
   while ( @ob_end_flush() );
} );

global $wpdb;

ob_start();
$sql_select = "SELECT * FRON TABLE ORDER BY ID ASC";

$results = $wpdb->get_results($sql_select, OBJECT);

return json_encode($results);
ob_get_clean();

but I see I don’t receive any results and looking in the log I see this error:

[02-Jan-2022 09:05:32 UTC] PHP Notice:  ob_end_flush(): failed to send buffer of zlib output compression (0) in /home/..../wp-includes/functions.php on line 5107

So since I added that remove_action as I read in other issues, it should have bypassed the ob_end_flush issue but it didn’t… Maybe I forgot something or could be that related to PHP version installed PHP Version 7.4.27?… Any direction would be appreciated… cheers!!!

btw, zlib_compression is on in php.ini

0
Luigino 7 months 2022-01-02T05:33:42-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse