Support » Plugin: Cache Enabler - WordPress Cache » PHP Fatal error: Unknown: Cannot use output buffering

  • Resolved Draikin


    I’m getting a HTTP Error 500 after activating the Cache Enabler plugin. Nginx logs show the following error:

    PHP message: PHP Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0

    I read about conflicts with Autoptimize and other minification plugins causing this problem, but I’ve tried disabling all other plugins, but even Cache Enabler alone still gives me this error. I used WP Super Cache + Autoptimize before attempting to switch to Cache Enabler. Any clues as to what may be causing this?

    One more note: before getting this error, the plugin didn’t work either but gave a different error that I managed to resolve. It didn’t have permission to write in the wp-content/cache folder, but (unlike other plugins) it didn’t point out that problem in the settings. Perhaps such a check could be added?

Viewing 15 replies - 1 through 15 (of 23 total)
  • @keycdn; I’m Autoptimize’s developer, cache enabler + autoptimize seems like a great combination (as cache enabler doesn’t do extensive CSS/JS optimization)! So let me know if I can assist to make (or confirm) compatibility! 🙂


    Thanks for the input Frank. I use Autoptimize along with Cache Enabler on several of my sites. Including, I have not run into the buffering issue before, so not sure if it is Cache Enabler or a possible conflict?

    Have you tried disabling all other plugins and running just Autoptimize and Cache Enabler to see what happens?

    Also whenever I see a buffer error in PHP I always recommend checking your PHP memory allocation size. Depending on your web host, it could be set too low. Also, I’m assuming you are using at least PHP 5.3?

    Plugin Author keycdn


    Is the Cache Minification disabled in the Cache Enabler settings?

    We haven’t see any conflict with Autoptimize and Cache Enabler.

    @frank: Would you mind to test the plugins on your end as well?

    Cache Minification is indeed disabled. Given that disabling all other plugins doesn’t resolve the issue, I’m assuming Autoptimize has nothing to do with this. The thing is that the error message doesn’t really tell me anything about where it’s failing, and the WordPress debug log doesn’t seem to offer any information either.

    Have you tried switching to one of the default WordPress themes to see if you still encounter the same error?
    Do you know what your PHP memory value limit is on your server?


    @draikin: nothing in your php errorlog?
    @keycdn; will try to test tomorrow


    @frank: I think the Nginx log is where the PHP errors are logged? The error I’m getting is in the first post, usually you get a more detailed error (which PH file and line number) but this isn’t giving me any more details. I’m using PHP 7.0 by the way.

    PHP memory limit: I tried setting it to 64MB since that’s indeed often associated with this problem, but it didn’t make a difference.

    Switching themes: I can’t easily test that at the moment, but I’ll look into that.

    Thanks for the help so far!

    I tried using the TwentyTwelve theme, but I’m encountering the same problem. But I did notice that the first page load appears to work. The second one just gives me a white screen. In the error log, I’m now noticing a different PHP warning: it’s failing with ” No such file or directory” on /wp-content/plugins/cache-enabler/inc/cache_enabler_disk.class.php on line 212, which tries to read the cached file from the disk.

    The only problem is, there’s no cached file. There’s not even a /wp-content/cache/cache-enabler/ directory. I’m not sure why, as it should have enough rights to write to that folder. Both WP Super Cache and Autoptimize can write to the cache directory, after all. And it’s the only error I’m seeing, I would expect some error related to writing the file prior to failing to retrieve it. So it’s like it’s not even trying to create the cached version.

    Plugin Author keycdn


    Ok, so the first problem is related to the theme. What theme are you using?

    Please delete the Cache Enabler completely and install it again. Try it again with the TwentyTwelve theme.

    @draikin; location of your php-error-log is set in your php.ini. could be the nginx-log, could be elsewhere 🙂

    @keycdn; tested CacheEnabler + AO on Apache+PHP7 (on Ubuntu) and all seems well at first sight. It would be nice if you (as some other page cache plugins already did) could hook into AO’s autoptimize_action_cachepurged action to automatically clear CE’s cache if AO’s get purged (this helps users avoid having pages in page cache which refer to autoptimized CSS/JS that was removed)?


    @keycdn: Additionally, if AO is active, the HTML & Inline JS minification might cause problems, so testing for AO being active and warning users (or even disabling those options) might prove useful?

    Plugin Author keycdn


    @frank: Thanks a lot for testing. Just added the hook for Autoptimize and it works perfectly! 🙂 Would be nice if you can add the Cache Enabler on your plugin page. We are going to add a section with confirmed compatible plugins as well.

    I made a completely separate test version based on a backup from the website, and there I can get Cache Enabler to work (also with Autoptimize), on my standard theme (child theme for Twenty Twelve). Which is actually annoying since I’m still not sure what’s causing the problem on the live website, and I can’t really afford to test it thoroughly there, so I might have to stick with WP Super Cache.

    The main reason I actually wanted to try Cache Enabler is to see if I could pre-compression to work, and unfortunately I’m encountering the same problem there as with WP Super Cache. Enabling it on the test website also causes content decoding errors in the browser, despite the fact that I set “gzip_static on” in the nginx config file. I’m guessing it must be related to my Nginx config file somehow.

    Plugin Author keycdn


    Pre-compression issues are not related to nginx but rather to PHP and the installed gzip library. I’m sorry that we cannot replicate your issue but feel free to provide more details in case you discover something.

    @keycdn; I’ll do a quick blogpost on keycdn’s cache enabler 🙂

    what do you think about:

    if AO is active, the HTML & Inline JS minification might cause problems, so testing for AO being active and warning users (or even disabling those options) might prove useful?

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘PHP Fatal error: Unknown: Cannot use output buffering’ is closed to new replies.