I have WordPress website running on a GoDaddy Linux host. The error PHP Fatal error: Cannot call overloaded function for non-object in wp-includes/class-wp.php on line 529
is being happening at random, usually in response to a POST request, I think.
- WordPress version: 3.8
- PHP version: 5.4.23
Line 529 of file wp-includes/class-wp.php
is the body of the following function in class WP:
function init() {
wp_get_current_user();
}
The error seems to be somehow related to the presence of the WooCommerce plugin. I haven't seen the error when the plugin is deactivated.
Unfortunately, removing WooCommerce is not an option so I need to discover how is the error being triggered and provide a solution. The problem is I don't know what to look for.
I want to understand what causes an error like the one above in a general case.
- Can anyone provide an example of PHP code that generates such an error? or
- an explanation of why it happens?
I'm hoping to be able to use that information to find a similar problem in WooCommerce's source code.
I took a quick look at PHP's interpreter source code (here and here) and found the line that generates the error message, but to be honest, that didn't help me.
A question in SO about the same error in a different application has an answer indicating the problem was caused by server overload. I don't think that's the case here. We don't get too much traffic.
A different question in WordPress SE offers two possible causes. Either the problem is associated with Alternate PHP Cache (APC) being enabled or the problem is caused by a plugin. Unfortunately nobody offers actual solutions or specific causes.
My case is similar to the one exposed in the question above: I have APC enabled (currently trying to get help from GoDaddy to disable it) and my tests suggest WooCommerce has some responsibility.
I appreciate all your help.