質問

I've installed Xcache 2.0.0 module on mac osx 10.7.3 , added it's configurations to php.ini like the following

; 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 = ""

put when I tried to use the following function

$test = "Hello";
xcache_set("test", $test );

this error appeared

Warning: xcache_set() [function.xcache-set]: xcache.var_size is either 0 or too small to enable var data caching

but Xcache settings are configured correctly as you can see from phpinfo()

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
役に立ちましたか?

解決

I too had the same problem, but got it working by changing the value of xcache.mmap_path

xcache.mmap_path =    "/tmp/xcache"

Why is the xcache.mmap_path value in phpinfo different from the value set in your configuration file?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top