errorlog_functions.php

4 posts by 2 authors in: Forums > CMS Builder
Last Post: January 6, 2020   (RSS)

By ht1080z - January 2, 2020

Happy New Year for everybody!

After I moved to a new server, started to get only error messages in the log like:

#41133 - E_ERROR: ob_start(): Cannot use output buffering in output buffering display handlers
/var/www/vhosts/wordigs.com/httpdocs/bcmAdmin/lib/errorlog_functions.php (line 494)

and not getting errors for any other different issues on my project.

Any advice would be appreciated,
Karls

By ht1080z - January 2, 2020

Hi Daniel,

PHP v7.3.13
cmsB v3.12 (Build 2163)

Thank you!

By daniel - January 6, 2020

Hi ht1080z,

This is an issue that has been fixed in newer versions of CMSB, so one solution is to upgrade to the latest version. It is also relatively simple to patch the bug as a short term fix.

To do so, replace the following line in /cmsb/lib/errorlog_functions.php (line 494):

ob_start(); echo '1'; $ob_get_clean_response = ob_get_clean();

With this:

    // test if ob_start/ob_get_clean() is working.
    $ob_get_clean_response  = '1';
    $inOutputBufferCallback = 0;  // PHP throws an error if you call output buffering inside an output buffer callback
    foreach (ob_get_status(true) as $bufferStatus) { if ($bufferStatus['type'] == 1) { $inOutputBufferCallback = true; break; }}
    if (!$inOutputBufferCallback) { ob_start(); echo '1'; $ob_get_clean_response = ob_get_clean(); }

One of the cases where this issue can pop up is when trying to log an error, so it's possible that adding this fix could expose a different error message. Let me know if you need any further help!

Thanks,

Daniel
Technical Lead
interactivetools.com