APC with WP-Cache - It lives!
Finally, the inner harmony has been archived. I tell ya troubleshooting these buggers sucked.
Anyway, it appeared other people have been having problems with getting these two bloody beasts to work together, too. So, I decided to take the task on myself to figure out just why these two are having temper-tantrum, even after adding the suggested fix by Mark Jaquith.
I have come baring the solution! Within the file wp-cache-phase2.php on line 219 is a call ob_end_clean(). This call is bad as what it does is flushes the the cache without displaying it. Change it to ob_end_flush() and the pages will magically work!
Also note, per Mark’s original troubleshooting post, you must also add wp-cache to your apc.filters.
For a quick recap:
- Add: apc.filters = wp-cache to your php.ini file.
- Edit wp-cache-phase2.php on line 219 change ob_end_clean() to ob_end_flush()
That will allow WP-Cache and APC to live in complete bliss. I have also verified with this edit, WP-Cache will still work without APC. For a quick version reference, I am using WP 2.0.4, WP-Cache2 and APC 3.0.11.
Mark Jaquith:
The
ob_end_clean/flushthing seems to only be needed on some servers… I’ve had no problem with it on many, but recently ran into a server that needed it.Posted on September 2nd, 2006 at 11:46 pm
guice666:
Could be a couple factors in it. I know on this server PHP is ran in FCGI mode, which could account for that. mod_php might auto flush its output buffer but due to CGI’s nature, fcgi version may not.
It may also be why you’ve just recently seen it as fcgi setups are still rare, but increasing in popularity.
Posted on September 3rd, 2006 at 7:10 am