Jump to content

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


seintitus

Recommended Posts

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();

}

}

}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...