开发者

PHP + APC + Zend: Classes cannot be found

I can't get APC to work properly with my Zend+Doctrine application. When I turn APC on I get the error:

Fatal error: Access to undeclared static property: Zend_Loader_Autoloader::$_instance in /var/www/libs/Zend/Loader/Autoloader.php on line 92

I've seen lots of people complaining about that but no one seem to have solved their problem, except by this guy: Access to undeclared static property: Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver::

I tried that aproach, upgrading APC from 3.1.3 to 3.1.9. It didn't work for me. I tried enabling nclude_once_override:

apc.include_once_override = 1

Didn't work either.

I also tried to get APC not to cache Zend_Loader_Autoloader by addint the following line to apc.ini:

apc.filters = Autoloader.php

It solved the primary problem, but caused another one:

Warning: call_user_func() expects parameter 1 to be a valid callback, class 'Zend_Loader' not found in /var/www/libs/Zend/Loader/Autoloader.php on line 472 Warning: call_user_func() expects parameter 1 to be a valid callback, class 'Zend_Loader' not fou开发者_StackOverflownd in /var/www/libs/Zend/Loader/Autoloader.php on line 472 Fatal error: Class 'Doctrine_Event' not found in /var/www/libs/Doctrine/Record.php on line 801

Next thing I did was get APC not to cache Zend_Loader

apc.filters = Autoloader.php,Loader.php

Solves the problem above, but other classes can't be found:

Fatal error: Class 'Zend_Exception' not found in /var/www/libs/Zend/Loader.php on line 99

I got APC not to cache Zend_Exception, but other classes won't be found.

Note that the errors occur only from the 2nd time the page loads on, after the cache is cleared. First page load works like a charm.

Anyone faced a similar problem and was able to solve it?

Thank you very much.


You need session_write_close():

\Zend_Session::setSaveHandler($foo);
register_shutdown_function('session_write_close');
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜