7
votes

I am using the Zend Autoloader to load Zend classes for integrating Zend_AMF with my application. Everything was working perfectly until I installed APC 3.1.9 and enabled it.

I am getting this error:

Fatal error: Access to undeclared static property: Zend_Loader_Autoloader::$_instance in C:\blahblah

I am assuming that APC seems to have trouble with autoloaders and static properties and static methods.

APC is version 3.1.9 and is installed on a Windows 7 machine with PHP 5.3.8 running as fastCGI on an Apache 2.2 server.

Has anyone seen this error before? If so, what are some ways to fix this?

1

1 Answers

10
votes

Looks like it was actually not the fault of the autoloader. APC sometimes does not play nice if you have a custom session handler.

The trick is to add this to the earliest part of your script (the first include if possible): register_shutdown_function('session_write_close');

This will tell PHP to finish writing and close (not destroy!) the session when the script finishes executing or is terminated (using exit() etc).