I experienced my website crashing apache today after activating the Skinr module. I have the APC cache enabled for caching my php pages. I got errors "Cannot redeclare class" errors for several database-related classes.
My guess is that somewhere in Skinr, include files containing class declarations are included without checking whether they have already been declared before. Using include_once may fix the problem. I could not find the critical piece of code, but removing the Skinr module fixed my site.
Sorry for not being able to provide more info on the issue, I hope it helps to track down a problem that may hit any productive site with APC enabled.
Cheers, Lars.
Comments
Comment #1
moonray commentedCould you please list the classes you refer to?
I'm not aware of any classes defined for Skinr. Are you sure this isn't due to some other module?
For reference, any files included use include_once already.
Comment #2
grobe commentedHi Moonray,
I had already added some wrappers to prevent redeclarations, but one would look like that:
PHP Fatal error: Cannot redeclare class DatabaseSchemaObjectExistsException in /var/www/drupal/drupal-7.10/includes/database/schema.inc on line 708, referer: http://www.xxx.net/userI am not sure whether this happens only when logged in as an admin (enabling the admin overlay) or not, but removing the Skinr-module definitely solves the problem on my site.
I am running Drupal on a Postgres-backend.
Cheers, Lars.
Comment #3
paulmicha commentedI just had the same issue, using APC and Postgres, but NOT using the Skinr module (this issue is the only relevant match in Google for this error) - Apache logs said :
In my case, I had declared a menu callback like :
I copy / pasted the core node module's edit tab menu declaration, but I had left the 'context' key - not knowing exactly what it did : it turns out when I removed this 'context' key from the menu callback, the fatal error was gone.
I don't know if it can help, but I thought I'd mention it just in case (I'm not sure where this analysis belongs either).
Comment #4
moonray commentedCan't replicate and seems there are other more probable causes. Closing.