I have no idea how to go about solving this very occasional funny state that PHP gets into. So any ideas whatsoever will be appreciated.
Maybe 3 or 4 times in the past year, my site will start returning 500 errors, and the logs show:
PHP Fatal error: Couldn’t execute method dw__autoload in Unknown on line 0
dw__autoload is registered with spl_autoload_register. When I restart apache the problem is gone and I forget about it for several months. I am running APC, php 5.3.2-1ubuntu4.10 on ubuntu 10.04.3. I realize there is not much to go on here!
Following the source code from the point of this error, I’d risk (psychic debugging since you have no more details) to say this happens because the autoload is being called with already an exception thrown.
That said, I can’t see exactly how this can happen. The current exception is cleared both before calling the autoloader and after calling each SPL autoloader function. I don’t think we ever can get to a conclusion without a script that reproduces this problem. The full set of possibilities is: