我在mac osx 10.7.3上安装了Xcache 2.0.0模块,将其配置添加到php.ini,如下所示
; zend_extension = /opt/local/lib/php/extensions/no-debug-non-zts-20090626/xcache.so extension = xcache.so
[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 64M
xcache.count = 1
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0
xcache.var_size = 32M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.mmap_path = "/dev/zero"
xcache.coredump_directory = ""
; per request settings
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
xcache.test = Off
xcache.experimental = Off
[xcache.coverager]
xcache.coverager = Off
; ini only settings xcache.coveragedump_directory = ""
当我尝试使用以下功能
时$test = "Hello";
xcache_set("test", $test );
出现此错误
警告:xcache_set()[function.xcache-set]:xcache.var_size为0或者太小而无法启用var数据缓存
但正如您从phpinfo()
中看到的那样,正确配置了Xcache设置XCache Support enabled
Version 2.0.0
Modules Built cacher coverager
Readonly Protection N/A
Cache Init Time 2012-05-09 16:07:12
Cache Instance Id 4687
Opcode Cache enabled, 67,108,864 bytes, 1 split(s), with 16384 slots each
Variable Cache enabled, 33,554,432 bytes, 1 split(s), with 16384 slots each
Shared Memory Schemes mmap
Coverage Auto Dumper disabled
Directive Local Value Master Value
xcache.admin.enable_auth On On
xcache.cacher On On
xcache.coredump_directory no value no value
xcache.count 1 1
xcache.coveragedump_directory no value no value
xcache.coverager Off Off
xcache.experimental Off Off
xcache.gc_interval 0 0
xcache.mmap_path /tmp/xcache /tmp/xcache
xcache.readonly_protection 0 0
xcache.shm_scheme mmap mmap
xcache.size 64M 64M
xcache.slots 16K 16K
xcache.stat On On
xcache.test no value no value
xcache.ttl 0 0
xcache.var_count 1 1
xcache.var_gc_interval 300 300
xcache.var_maxttl 0 0
xcache.var_size 32M 32M
xcache.var_slots 16K 16K
xcache.var_ttl 0 0
答案 0 :(得分:4)
我也遇到了同样的问题,但是通过更改xcache.mmap_path
xcache.mmap_path = "/tmp/xcache"
为什么phpinfo中的xcache.mmap_path
值与配置文件中设置的值不同?