WordPress dashboard fatal error; blame & tweak APC!

I upgraded APC a couple of days ago and subsequently encountered a fatal error when trying to load my WordPress dashboard (but not the other wp-admin pages);

Fatal error: Call to undefined function wp_dashboard_setup() in wp-admin/index.php on line 15

Google confirmed the obvious; APC and WordPress didn’t get along (again), and the most common solution (next to switching from APC to XCache or eAccelerator) is to alter wp-admin/index.php by replacing

require_once(ABSPATH . 'wp-admin/includes/dashboard.php');

with
require_once('includes/dashboard.php');

But I prefer not to change code that is bound to be overwritten at every WordPress upgrade and surely other PHP-apps suffer from the same problem, so instead I tweaked APC by adding the following line to my configuration:

apc.include_once_override=0

This tells APC not to optimize include_once (it’s complicated). Why I have to explicitly specify this, if “0” is the default value anyhow, is beyond me though.

One thought on “WordPress dashboard fatal error; blame & tweak APC!

  1. Pingback: Getting The Most Out Of Wordpress And Fixing A Crashed Blog

Leave a Reply

Your email address will not be published. Required fields are marked *