I posted the fix for this several times already in this forum but it seems to be buried 🙁 . Sounds like you’re using php 7? If so you will need to adjust the ob_callback() function header’s parameter to remove the ampersand (&). It’s been a while but i believe it is in the TotalCache.php file. Give it a try.
Thanks for responding. I’m using php 5.5.31, do you think the same fix will work? Also, if possible can you include a link for your previous post?
For those of you who need this in the future…
Kimberly pointed me in the right direction and here is how to fix this issue:
Find this folder in your Cpanel
public_html/wp-content/plugins/w3-total-cache/lib/W3/Plugin
Then find this function
function ob_callback(&$buffer) {
For me it was on line 512 and was coded as such
* @param string $buffer
* @return string
*/
function ob_callback(&$buffer) {
global $wpdb;
if ($buffer != '') {
All you need to do is delete the ampersand (&)
When finished it looks like this
* @param string $buffer
* @return string
*/
function ob_callback($buffer) {
global $wpdb;
if ($buffer != '') {
Now you’re all set 🙂
PS Don’t forgot to backup just in case
Thanks Kimberly and Adam! That seemed to do the trick for me, too. Since the path and filename are split across two posts above: here’s the full path/file:
… /wp-content/plugins/w3-total-cache/lib/W3/Plugin/TotalCache.php
Oops, sorry about that. Thanks for the correction.
There is another better fix -> Uninstall W3 Total Cache. And this error will disappear. I did it, worked perfectly.
Reason why I did it:
1. With next update you will have that error back!
2. They had enough time to fix it and send out new update to fix it. Since they have not did that, means that there may be much much worse problems, lots’ of bad code.
Thanks a lot for the Fix with the &, had the same error.
I agree with edragonxx. Uninstalling W3 TC is the best solution. This plugin has not been supported for quite some time. Last year I purchased a support ticket. Despite numerous attempts to contact them, no one every responded. I uninstalled W3TC and moved to WPEngine. The only reason I am back today is because they charged my credit card for an annual subscription. Of course, when I called the billing phone number, no one answered. Apparently, the only thing this company can do is charge credit cards.
This is a bad solution due to it not being future-proof and unless you know the internal workings of the entire plugin this could cause unwanted side effects.
There is an obvious incompatibility with PHP 7 and I’m not sure if the authors are still working on this as it is a 5 second patch.
Could an author please jump in on these to advise?
All the best