wiki:XcacheIni

Version 9 (modified by moo, 21 months ago) (diff)

--

INI settings for XCache

It's time to explain xcache.ini itself, finally, no matter if you do or don't have all the basics in mind.

Loading XCache module

;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
zend_extension = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so
;; For windows users, replace xcache.so with php_xcache.dll
zend_extension_ts = c:/php/extensions/php_xcache.dll
;; or install as extension, make sure your extension_dir setting is correct
; extension = xcache.so
;; or win32:
; extension = php_xcache.dll

XCache Administration

NameDefaultChangeable
xcache.admin.user"mOo"PHP_INI_SYSTEM
xcache.admin.pass""PHP_INI_SYSTEM
xcache.admin.enable_auth"on"PHP_INI_SYSTEM
xcache.testOffPHP_INI_SYSTEM
xcache.coredump_directory""PHP_INI_SYSTEM
xcache.disable_on_crash""PHP_INI_SYSTEM
xcache.admin.user string
auth name.
xcache.admin.pass string
Should be md5($your_password), or empty to disable administration.
xcache.test string
Turn on to enable testing functionals. It will be explained where the option is needed.
xcache.coredump_directory string
Directory to save core dump on crash (SIGSEGV SIGABRT). Leave it empty to disable or something like "/tmp/phpcore/" to enable. Make sure it's writable by php (without checking open_basedir).
xcache.disable_on_crash string
Disable XCache caching when PHP crash for any reason
xcache.admin.enable_auth string
Disable XCache builtin http authentication if you plan on handling authentication yourself. Be aware that any vhost users can set up admin page, if builtin http auth is disabled, they can access the page with out any authentication. So it is suggested that you disable mod_auth for XCache admin pages instead of disabling XCache builtin auth. This option is 1.2.x only since 1.2.1

XCache Cacher

NameDefaultChangeable
xcache.cacherOnPHP_INI_SYSTEM
xcache.size0PHP_INI_ALL
xcache.count1PHP_INI_SYSTEM
xcache.slots8KPHP_INI_SYSTEM
xcache.ttl0PHP_INI_SYSTEM
xcache.gc_interval0PHP_INI_SYSTEM
xcache.var_size0PHP_INI_SYSTEM
xcache.var_count1PHP_INI_SYSTEM
xcache.var_slots8KPHP_INI_SYSTEM
xcache.var_ttl0PHP_INI_ALL
xcache.var_maxttl0PHP_INI_SYSTEM
xcache.var_gc_interval300PHP_INI_SYSTEM
xcache.readonly_protectionOffPHP_INI_SYSTEM
xcache.mmap_path"/dev/zero"PHP_INI_SYSTEM
xcache.cacher boolean
Enable or disable opcode cacher. Not available if xcache.size is 0.
xcache.size int
0 to disable, non 0 to enable. Check if your system mmap allows.
xcache.count int
Specify how many chunks to split the cache. see SplittedCache
xcache.slots size
Just a "slots" hint for hash, you can always store count(items) > slots. It can be (count(items) * n) where n is 0.2 to 1, or leave it as is. More slots means faster searching the cache but take more memory.
xcache.ttl seconds
Ttl (Time To Live) value for the php entry (cached opcodes of a file), 0=forever.
xcache.gc_interval seconds
Garbage collection interval.
xcache.var_size int
xcache.var_count int
xcache.var_slots size
Same as above, but for variable data.
xcache.var_ttl seconds
Default ttl for variables api, xcache_(get|set|inc|dec) etc.
xcache.var_maxttl seconds
A longer ttl when using variables api is limited to below max ttl.
xcache.var_gc_interval seconds
Garbage collection interval for variables api.
xcache.readonly_protection boolean
If ReadonlyProtection is turned on, it will be a bit slower, but much safer. This option isn't available for /dev/zero.
xcache.mmap_path string
for *nix, xcache.mmap_path is a file path, not directory. for win32, xcache.mmap_path is anonymous map name, not a file path. Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection, 2 group of php won't share the same /tmp/xcache.

XCache Optimizer

NameDefaultChangeable
xcache.optimizerOffPHP_INI_ALL
xcache.optimizer boolean
Enable optimizer.

XCache Coverager

NameDefaultChangeable
xcache.coveragerOffPHP_INI_ALL
xcache.coveragedump_directory"/tmp/pcov/"PHP_INI_SYSTEM
xcache.coverager boolean
Enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt executing performance)
xcache.coveragedump_directory string
Directory to dump coverage data. Make sure it's readable (care open_basedir) by coverage viewer script. Requires xcache.coverager=On