admin管理员组文章数量:1122832
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
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
Share Improve this question edited Jan 2, 2022 at 10:53 Luigino asked Jan 2, 2022 at 10:33 LuiginoLuigino 1035 bronze badges 2 |1 Answer
Reset to default 0Found the solution at the problem: using "return" wasn't the right way... have to use "echo" in this way because it isn't a function but a simple PHP that gives back an object. Thanks again to all
本文标签: pluginsobendflush() failed to send buffer of zlib output compression (0) in external php
版权声明:本文标题:plugins - ob_end_flush(): failed to send buffer of zlib output compression (0) in external php 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736294622a1929397.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
ob_get_clean()
after areturn
,return
, well, returns the value (in this case a json string) and stops there, no other code after return is being executed. But in genereal this code is strange, why there is a return? how do you access this code? why is there evenob_start()
or anyob_
for that matter? – Buttered_Toast Commented Jan 2, 2022 at 12:19