Adventures with WP-Cache2 & APC

Update 3: see update 2 for the solution!

APC (Alternative PHP Cache) is great for WordPress. It caches the compiled WordPress PHP files and greatly speeds up subsequent loads. I even wrote a WordPress plugin to make WordPress store its objects in APC instead of in the default file-based object cache.

WP-Cache2 is also great for WordPress, because it caches the HTML output of WordPress for a specified period.

So if both are good, together they should be awesome, right? Well… in theory, yes. Unfortunately, I’ve been having a heck of a time getting them to play together. What would happen was that pages would start showing up blank. Just a white page. Real helpful. The same thing happened when you tried to access /wp-admin/ The only way to fix it was to delete WP-Cache2. In desperation, I removed all the error-silencing @ from WP-Cache2. Ah. It was some problem with class_exists() and APC. Apparently, APC doesn’t play well with class_exists().

Here is the solution I came up with… it seems to be working. I’ve been able to enable/disable WP-Cache2, restart Apache2, flush APC, with no White Page of Death so far!

[ I have removed my solution, to keep from misleading people, as it gave me problems later on ]

Restart Apache, flush your WP-Cache2 cache, and cross your fingers. I’ll update if I have any problems with this.

Update: Well that was short-lived! I’m still looking for a solution. It may involve naming the wp-cache-config.php file differently for each WP install that is running WP-Cache2.

Update 2 (SOLUTION): This seems promising. In php.ini in the [apc] section I set apc.filters = wp-cache-config which should exclude wp-cache-config.php and wp-cache-config-sample.php from being cached by APC.

Update 3: Yep! That did it!

289 thoughts on “Adventures with WP-Cache2 & APC

  1. Good luck with this =). I will be keeping an eye out to see what you come up with and I just hope that there is a solution that doesn’t require access to php.ini (although I know some php.ini settings can be changed from within a script itself, kind of like how .htaccess can change httpd.conf settings).

  2. Same configuration, almost the same problem. I did this:

    apc.filters = “-.*cache.*\.php”, “podpress\.php”;

    podpress wasn’t working for me…

  3. Aha. That’s what I needed. I was just trying to install APC today, and ran into the blank-page problem. Filtering out wp-cache-config seems to have things working. I wonder why it conflicts like that?

  4. WP-Cache2 declares a class conditionally… and apparently APC doesn’t do well under those circumstances. I believe the error was due to the class not existing, because APC thought it didn’t when it should have. Blank page because errors are all turned off and everything is @silenced. I experimented with all sorts of things to make it work, but with no luck. This might change as APC matures… I hear it is under consideration for PHP6, but for now, filtering out wp-cache-config is a viable workaround.

  5. Pingback: High Performance WordPress - Asymptomatic

  6. Pingback: sitepoint Blog

  7. Pingback: Guide To Optimizing WordPress Servers » Connected Internet

  8. How about something like PHPA which is also free and has gotten good reviews.

    http://www.php-accelerator.co.uk/

    It’s supposedly better than zend and yahoo uses it.
    Works with php 4.4.1 too.

    I don’t have it (or root) on my current host or I’d try it, but I’ve had it on previous hosts and it’s transparent.

  9. Pingback: benchodroff.com - » PHP Caching with APC and WP-Cache

  10. I am running the latest APC and WP-Cache and I’m getting the ‘white page of death’ error. I have tried a variety of filter settings in apc, flushing the wp-cache, and restarting apache. No luck yet. Mark – do you have WP-Cache successfully working with APC? As of now, I’m just going to use APC.

    Any other suggestions?

  11. Unfortunately, no luck here as well. Just as Ben’s problem; blank screen on first load, but subsequent loads work. I have removed all error suppressions from all wp-cache files. Even my log files are completely clean (after a couple file_exists() additions to the code. I’m still troubleshooting though…

  12. Pingback: Delusioned :: APC with WP-Cache - It lives!

  13. Solution has been discovered! I have posted the solution on my blog for details, but so you know I’m not link spammin ya, here’s how: Edit wp-cache-phase2 list 219. Change ob_end_clean() ob_end_flush().

    The problem is ob_end_clean() cleans out the buffer without actually flushing it to the screen and I don’t see any flush() calls before hand. Changing it to ob_end_flush() will end the output buffer and flush all data to standard out.

    I have tested this solution with and without APC and it seems to be working.

  14. Pingback: Thanks WP-Cache!!! « Jayant Kumar Gandhi

  15. Pingback: Ultimate Wordpress Site Speed - Install WP-Cache2 AND APC At The Same Time » Connected Internet

  16. Pingback: Cow Powered » Blog Archive » Speeding up Wordpress with APC

  17. Pingback: Circle Six Blog » Blog Archive » DiggProof your Wordpress

  18. Pingback: Mahmood’s Den » Blog Archive » New AJAX Comments module installed

  19. Hi there,

    I was new to wordpress and those plugin staff. I had install this wp-cache plugin. I had enable the plugin from the optioin there.

    So how can i know that this plugin had take effect and how can i view the statistic thing?

    Anyhting to be check and any setting needed?

    Thanks

    Eric

  20. Pingback: Firdaus Progressindo Purwa » speed up wordpress » Blog Archive

  21. Pingback: SigT

  22. Pingback: links for 2007-02-25 at Idealabs

  23. Pingback: zlim! » Blog Archive » 4+1 maneras de mejorar la velocidad de WordPress

  24. I am sorry for breaking WP-Cache/WP-Cache2 with APC … with a decent enough test case, that bug was fixed for good today (for php4, php5 having had that fix for months).

  25. Pingback: 苦牢之最後一年

  26. Pingback: WordPress Wednesday: New Security Release, Updated WordPressMU, More WordPress Plugins, and Time to Get Naked at The Blog Herald

  27. Pingback: WordPress Wednesday: New Security Release, Updated WordPressMU, More WordPress Plugins, and Time to Get Naked » TechAddress

  28. Pingback: Alex King’s Popularity Contest plug-in for Wordpress | Eric Cheng’s Journal

  29. Pingback: The WordCamp Report » HyperDB and High Performance WordPress PLUS

  30. Pingback: 菠萝艾蔻 » 4+1 Ways To Speed Up WordPress With Caching

  31. Pingback: McBOX » Blog Archive » Ways To Speed Up WordPress With Caching

  32. Pingback: McBOX » Blog Archive » Ways To Speed Up WordPress With Caching

  33. I just found this. Interesting article as I am setting up a multi-server architecture for something unrelated to blogging and was investigation PHP opcode cache, APC and eAccelerator.

    I plan to host my own blog on my own server in a colo soon (in the near future) so I will let you know how it goes.

  34. Pingback: breaker of stuff, destoryer of things, sometimes ninja | configuring wp-cache to work with apc

  35. Pingback: configuring wp-cache to work with apc | breaker of stuff, destroyer of things

  36. Pingback: PECL APC Cache installieren - eAccelerator, Pfad, PECL, OP-Caches, Befehl, Datei, Optimizer, Paket - LazyBrain.de

  37. Pingback: A Non-Traditional Wordpress Tuning Guide - Part II | Online Shopping Network

  38. Pingback: เพิ่มความเร็ว Wordpress ฉบับลูกครึ่งไืทย-อังกฤษ | iDatabase Blog l บันทึกออนไลน์ของคนทำเว็บ ปี 1

  39. was new to wordpress and those plugin staff. I had install this wp-cache plugin. I had enable the plugin from the optioin there.

  40. Pingback: yabanc yksek prli bloglar bele backlink - Teknoloji ve Webmaster Platformu

  41. Pingback: 4+1 Ways To Speed Up WordPress With Caching | rapid-DEV.net

  42. veri kurtarma, data veri kurtarma, veri kurtarma indir, kurtarma
    programı, veri kurtarma programı, disk kurtarma, disk veri kurtarma, veri kurtarma full, data
    recovery, veri kurtarma format, silinen veri kurtarma, hdd veri kurtarma, silinen dosyaları
    kurtarma, data kurtarma, veri nedir

  43. How did you track down the error to that one file? I’ve got a server with APC which is serving blank white pages (with 500 status), but there’s nothing in the PHP or Apache error logs… most frustrating.

  44. I’m having the blank-page problem with WordPress 2.8.4 + APC without the WP-Cache2 plugin, does anoy one else had this problem before?
    What is odd, is that the blank pages just come from time to time, what I mean is the blog is working right now, but at any time it stars to serv blank pages, and then fix it by it self!

  45. Pingback: Speed Up WordPress With Caching | -PiZi-

  46. Sitemizde sesli görüntülü chat, kamerali sohbet chat, sesli sevgi, görüntülü sohbet, sesli dini sohbet, sesli sohbet siteleri, görüntülü sohbet, tikla sohbet,sesli chat, seslichat, seslisohbet, kamerali chat, sesli cet, kamerali sohbet, canli sohbet, sohbet odalari, sesli kamerali sohbet, sesli görüntülü sohbet, sesli chat sohbet, sesli kamerali chat, sesli dunya chat, sesli kamerali sohbet, sesli görüntülü sohbet

  47. Thanks Admin Thanks Admin Thanks Admin Thanks Admin Thanks Admin Thanks Admin Thanks Admin Thanks Admin Thanks Admin

  48. space constraints prevent all comments from appearing. We will only approve comments that are directly related to the blog, use appropriate language and

  49. prevent all comments from appearing. We will only approve comments that are directly related to the blog, use appropriate language.

  50. As you have a blog about sharing was very nice.
    I host it and different places in search of an active subject.I thank you for informationn

  51. Thank you editors for the topic.Its include a lot of useful informations.i join this blog i couldnt see unnecessary arguments and it makes us happy thnx all moderator n editors.

  52. This post was very well written, and it also contains a lot of useful facts. I appreciated your distinguished way of writing

    the post. Thanks, you have made it easy for me to understand.

  53. Kosmodisk Classic Set, kan dolaşımını kolaylaştırarak yorgun kasların ısınmasına, yumuşamasına ve rahatlamasına dolayısıyla ağrıların azalmasına yardımcı olur.

  54. There is a more straightforward and general solution to eliminating the WordPress white screen of death issue when using APC Cache

    Since the problem appears to reside with include file(s)
    Set apc.include_once_override=0 in your /etc/php5/conf,d/apc.ini file

    Danny

  55. For information, thank you. However, I want to say something … I view some of the pictures on your site. Is there a problem?

  56. Facebook and leave it at that. It’s just software so like anything else, how it’s used depends on the person using it. Your personal informatio­­n is never yours if you use social networking­­. They hide that in the privacy policies, but it’s there.

  57. is getting all users to think about privacy, but the transition tool and other changes actually discourage or eliminate some privacy protections that Facebook users currently employ.

  58. Welcome to the Moncler Jacket Sale at moncler jackets- Moncler Jacket Sale,Cheap moncler coats for Women and Men are Provided In moncler coats sale

  59. it really should default to full lockdown. not everyone even knows about the security settings or reads about it.

  60. This also directly ignores the more than 1.5 million Facebook users in 24 groups who find the status updates of their “friends” annoying. There is every indication that it is in the worst interests of

  61. orge V in 1911 Much of the future of the Red and Black is played on this qualification for the C1, but at the crucial moment, things are emerging evil It was totally absent in the determination, there is always next, late A deafening roar rises from the place

  62. I just wanted to comment your blog and say that I really enjoyed reading your blog post here.
    It was very informative and I also digg the way you write!All of them make sense and are very helpful. Keep posting.

  63. çok Kırmızı ve Siyah geleceği C1 için bu yeterlilik üzerinde oynanan 1911 yılında V orge kritik bir anda, her şey bu belirlenmesinde tamamen yoktu kötülük ortaya çıkmakta, her zaman yanında, geç bir sağır kükreme yükselir var yerden

  64. I would like to point out my gratitude for your generosity for men and women who actually need help with this particular issue. Your special commitment to passing the solution around was extremely powerful and have all the time enabled others like me to realize their targets. Your amazing helpful guideline can mean this much to me and further more to my mates. Many thanks; from each one of us.

  65. After study a few of the blog posts in your website now, and I actually like your approach of blogging. I bookmarked it to my bookmark web site list and can be checking back soon. Pls check out my website online as nicely and let me know what you think.

  66. Pingback: Trine 2 Review (Xbox 360) | My Games 365

Comments are closed.