WordPress warning “Parameter 1 to W3_Plugin_TotalCache::ob_callback() expected to be a reference, value given” with PHP 7.0.9

I recently migrated my WordPress site from Vultr to my own server and as part of that migration, I decided to give NginX a go as my web server. However on launch, my New Relic monitoring kept complaining about a high error rate even though the server itself was performing normally. When I decided to take a look at the logs I saw the following:

screen-shot-2016-09-10-at-2-35-54-pm

Or Parameter 1 to W3_Plugin_TotalCache::ob_callback() expected to be a reference, value given

After doing some quick research, I found a number of entries this one. After a little bit of digging, I eventually found this one and after running through it, it seems to work.

The general notion is to replace the following line:

function ob_callback(&$buffer)

with the following line

function ob_callback(&$buffer)

I first had to identify which lines were effected and I did that with a simple grep command in my terminal

grep -r ‘function ob_callback(&$buffer)'

which yielded the following files for me:

screen-shot-2016-09-10-at-2-41-47-pm

I simply did a search and replace and the problems seems to be solved.