问题描述
我正在尝试将xcache与zend框架一起使用来缓存Zend_Db_Table_Abstract中的元数据,以便每个表只对描述查询调用一次.在我的引导程序中实现xcache并运行应用程序时,出现以下错误:
I am trying to use xcache with zend framework to cache the metadata from Zend_Db_Table_Abstract so that describe queries are only called once per table. When implementing xcache into my bootstrap and running the application, I am being presented with the following error:
Warning: xcache_get() [function.xcache-get]: xcache.var_size is either 0 or too small to enable var data caching in /home/randall/htdocs/lib/Zend/Cache/Backend/Xcache.php on line 95.
我已经调整了php.ini中的设置:
I have adjusted the settings in my php.ini:
; XCACHE
626 [xcache-common]
627 zend_extension=/usr/lib/php5/20060613/xcache.so
628
629 [xcache-admin]
630 xcache.admin.enable_auth = On
631 xcache.admin.user = "user"
632 xcache.admin.password = "********"
633
634 [xcache]
635 xcache.shm.scheme = "mmap"
636 xcache.size = 128M
637 xcache.count = 4
638 xcache.slots = 8K
639 xcache.ttl = 0
640 xcache.gc_interval = 0
641
642 xcache.var_size = 64M
643 xcache.var_count = 1
644 xcache.var_slots = 8K
645 xcache.var_ttl = 0
646 xcache.var_maxttl = 0
647 xcache.var_gc_interval = 300
648 xcache.test = Off
649
650 xcache.readonly_protection = Off
651 xcache.mmap_path = "/tmp/xcache"
652 xcache.coredump_directory = ""
653
654 xcache.cacher = On
655 xcache.stat = On
656 xcache.optimizer = Off
657
658 [xcache-coverager]
659 xcache.coverager = On
660 xcache.coveragedump_directory = ""
但是无论我将xcache.var_size参数设置为什么,我仍然继续得到该错误.这发生在xcache 1.2.2和1.3.0上.任何帮助将不胜感激.
but i still continue to get the error no matter what I set the xcache.var_size parameter to. This occurs on xcache 1.2.2 and 1.3.0. Any help would be appreciated.
推荐答案
运行phpinfo()
,并查看这些设置是否正确/以确保加载了正确的php.ini.另外,尝试将mmap_path设置为"/dev/zero"(它所做的就是禁用readonly_protection,无论如何您都没有启用它)...
Run a phpinfo()
, and see if those settings are accurate/to make sure the correct php.ini is loaded. Also, try setting the mmap_path to "/dev/zero" (All it does is disable readonly_protection, which you don't have enabled anyway)...
这篇关于Xcache var_size错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!