Jump to content

I am getting this error on my laravel application "ob_end_flush(): failed to send buffer of zlib output compression (0)


Recommended Posts

Posted

Below I am including the code where it throws the error message:

 

**

* Cleans or flushes output buffers up to target level.

*

* Resulting level can be greater than target level if a non-removable buffer has been encountered.

*

* @final

*/

public static function closeOutputBuffers(int $targetLevel, bool $flush): void

{

$status = ob_get_status(true);

$level = \count($status);

$flags = PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE);

 

while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || ($s['flags'] & $flags) === $flags : $s['del'])) {

if ($flush) {

ob_end_flush();

} else {

ob_end_clean();

}

}

}

Posted

Please post the following information:

  • Your cPanel username
  • Your main domain
  • The server that you are on
  • The version of PHP that you're using
Posted

Try putting this code in your php script:

 

ini_set("zlib.output_compression", "Off");

Zlib.compression is on by default on Tommy's php 7.3. Ob_end_flush and zlib.compression don't play well together. You can usually only use one or the other.

Posted

I'm not sure how Laravel works, but most php software has one index.php and then includes all the rest of the code that it needs. It might be enough to put it just in the main index.php file.

Posted

I find it strange thou because yesterday I installed the same script here and it was working fine but I decided to delete it since I was having slight error with sending email. But now that am trying to reinstall. It has completely refused to work.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...