开发者

Getting APC to play nice with spl_autoload_register

开发者 https://www.devze.com 2023-04-13 03:52 出处:网络
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 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.开发者_JS百科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?


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号