zlib.output_compression problem in CI 4.1.4 |
Anybody help???
I have just uploaded a CI4 project (latest version 4.1.4) to cPanel but no views are rendered. The error displayed is: CodeIgniter\Exceptions\FrameworkException Your zlib.output_compression ini directive is turned on. This will not work well with output buffers. I turned off the directive in php.ini but this time an ErrorException#1 error was encountered. Thanks!
/app/Config/Events.php
Removing this code in app/Config/Events.php, or turning off output_compression in php.ini is a temp solution. while (\ob_get_level() > 0) { \ob_end_flush(); } \ob_start(function ($buffer) { return $buffer; }); You can just comment it out
(10-19-2021, 10:57 AM)devprecious Wrote: /app/Config/Events.php Thanks @devprecious, I did that before, and it made no difference. Still trying to find a solution though.
I just set my environment on testing, its an awful solution but is something.
What version of PHP. We had issues with PHP8 and cPanel working correctly with CI. IIRC cpanel's version of PHP 8 doesn't currently support the international plugin and that will throw a #1 error
The optimal soluciton to this problem is changing some lines in the cpanel php.ini
Thanks for your suggestion guys.
What I did to resolve the problem was to upgrade to PHP 7.4 from PHP 7.3, enable all required PHP and MySQL extensions, with the zlib.output_compression turned off.
Just had same issue.
When you do "var_dump(ini_get('zlib.output_compression')))" the output is string(3) "Off" So the code in events.php line 28 "if (ini_get('zlib.output_compression'))" will resovlve to "true" as the string "off" is seen as not false. Not sure if php maybe changed something on the query, but I think the CI "if" statement should be updated to check if its on really on. |
Welcome Guest, Not a member yet? Register Sign In |