• Resolved ddmboss

    (@ddmboss)


    Hey I recently upgraded my site to PHP 7 stable and I noticed that it is throwing an error on the login page, but everything else is working fine, just the error showing.

    Warning: Parameter 1 to W3_Plugin_TotalCache::ob_callback() expected to be a reference, value given in /srv/users/serverpilot/apps/wordpress/public/wp-includes/functions.php on line 3297

    I’m concerned because anyone who goes on the login page will see the error.

    https://www.ads-software.com/plugins/w3-total-cache/

Viewing 13 replies - 1 through 13 (of 13 total)
  • I have the same problem. This problems seems to be there longer, I found: https://github.com/gadelkareem/wp-w3-total-cache/commit/e71030e89f4cd666742ae2ec39451782beb42f3a – but do not now where to chance by myself…

    Oh this is an easy fix. To get php7 working with w3tc do this:

    1. Open: /wp-content/plugins/w3-total-cache/lib/W3/Plugin/TotalCache.php
    2. Go to line 512
    3. Change &$buffer to be $buffer. So you are removing the ampersand (&).
    4. Save (and upload change to website)

    Regards,
    Kimberly

    Thread Starter ddmboss

    (@ddmboss)

    Thanks, Kimberly that fixed it

    Thanks very much. Error has disappeared.

    Thanks Kimberly for sharing. Jo?l

    I just wanted to post to say thanks to Kimberly for the fix that she has here! I was having an issue with the CDN aspect of the plugin, and this completely cleared it up! Thank you so much!

    Not working with WP 4.5 and php 7.0.9.

    When editing the file, somage pages become blank.

    Same as above this fix no longer works.

    Hopfully this plugin will get updated soon to support php 7

    Yea for php 7.0.9 it seems one has to replace ALL occurrences of &$buffer with $buffer. That resolves the problem. Not sure why i didnt do that way back when 7.0 was released. Anyway, w3tc using WP4.5+php7.0.9 works perfectly for me.

    For your convenience, here are the files you need to update (and line #s):

    WP_PATH\wp-content\plugins\w3-total-cache\lib\W3\PgCache.php:331
    WP_PATH\wp-content\plugins\w3-total-cache\lib\W3\Plugin\BrowserCache.php:116
    WP_PATH\wp-content\plugins\w3-total-cache\lib\W3\Plugin\Cdn.php:242
    WP_PATH\wp-content\plugins\w3-total-cache\lib\W3\Plugin\Minify.php:131
    WP_PATH\wp-content\plugins\w3-total-cache\lib\W3\Plugin\NewRelic.php:31
    WP_PATH\wp-content\plugins\w3-total-cache\lib\W3\Plugin\TotalCache.php:512

    The last file listed is the one you already updated but i just include it since most people rarely read any other thread conversation beyond the first and last.

    Cheers,
    Kimberly

    @kimberly, are you interested to collaborate at community edition of w3tc on github?

    https://github.com/szepeviktor/fix-w3tc

    Sure, count me in (git name: amiga-500).

    Thanks for this Kimberly! ??

    Thank you Kimberly! this solved my issue where urls were not getting rewritten to use the CDN. I hope there’s an update to the plugin to resolve this issue soon.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Problems with PHP 7’ is closed to new replies.