Title: Problems with PHP 7
Last modified: August 30, 2016

---

# Problems with PHP 7

 *  Resolved [ddmboss](https://wordpress.org/support/users/ddmboss/)
 * (@ddmboss)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/problems-with-php-7/)
 * 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://wordpress.org/plugins/w3-total-cache/](https://wordpress.org/plugins/w3-total-cache/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [Ralf R.](https://wordpress.org/support/users/ralfreymann/)
 * (@ralfreymann)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825147)
 * I have the same problem. This problems seems to be there longer, I found: [https://github.com/gadelkareem/wp-w3-total-cache/commit/e71030e89f4cd666742ae2ec39451782beb42f3a](https://github.com/gadelkareem/wp-w3-total-cache/commit/e71030e89f4cd666742ae2ec39451782beb42f3a)–
   but do not now where to chance by myself…
 *  [Kimberly](https://wordpress.org/support/users/amiga500/)
 * (@amiga500)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825157)
 * 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](https://wordpress.org/support/users/ddmboss/)
 * (@ddmboss)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825193)
 * Thanks, Kimberly that fixed it
 *  [timholz](https://wordpress.org/support/users/timholz/)
 * (@timholz)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825302)
 * Thanks very much. Error has disappeared.
 *  [Joto19](https://wordpress.org/support/users/joto19/)
 * (@joto19)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825324)
 * Thanks Kimberly for sharing. Joël
 *  [dclardy](https://wordpress.org/support/users/dclardy/)
 * (@dclardy)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825356)
 * 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!
 *  [Camille Ollié](https://wordpress.org/support/users/boscorelly34/)
 * (@boscorelly34)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825358)
 * Not working with WP 4.5 and php 7.0.9.
 * When editing the file, somage pages become blank.
 *  [b348xyx](https://wordpress.org/support/users/b348xyx/)
 * (@b348xyx)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825359)
 * Same as above this fix no longer works.
 * Hopfully this plugin will get updated soon to support php 7
 *  [Kimberly](https://wordpress.org/support/users/amiga500/)
 * (@amiga500)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825360)
 * 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
 *  [nigro.simone](https://wordpress.org/support/users/nigrosimone/)
 * (@nigrosimone)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825361)
 * [@kimberly](https://wordpress.org/support/users/kimberly/), are you interested
   to collaborate at community edition of w3tc on github?
 * [https://github.com/szepeviktor/fix-w3tc](https://github.com/szepeviktor/fix-w3tc)
 *  [Kimberly](https://wordpress.org/support/users/amiga500/)
 * (@amiga500)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825362)
 * Sure, count me in (git name: **amiga-500**).
 *  [Bjørn](https://wordpress.org/support/users/zukku/)
 * (@zukku)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-6825363)
 * Thanks for this Kimberly! 🙂
 *  [mattiem](https://wordpress.org/support/users/mattiem/)
 * (@mattiem)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-8219377)
 * 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.

 * ![](https://ps.w.org/w3-total-cache/assets/icon-256x256.png?rev=1041806)
 * [W3 Total Cache](https://wordpress.org/plugins/w3-total-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/w3-total-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/w3-total-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/w3-total-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/w3-total-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/w3-total-cache/reviews/)

## Tags

 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 13 replies
 * 11 participants
 * Last reply from: [mattiem](https://wordpress.org/support/users/mattiem/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/problems-with-php-7/#post-8219377)
 * Status: resolved