wiki:XcacheIni

Version 16 (modified by AlexisWilke, 11 months ago) (diff)

Fixed a reference to "variable" when it was supposed to be "opcode"

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

;; non-Windows example:
extension = xcache.so
;; Windows example:
; extension = php_xcache.dll

use of zend_extension=xcache.so is no longer supported since 3.0

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"off"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.shm_scheme"mmap"PHP_INI_SYSTEM
xcache.mmap_path"/dev/zero"PHP_INI_SYSTEM
xcache.readonly_protectionOffPHP_INI_SYSTEM
xcache.size0PHP_INI_SYSTEM
xcache.count1PHP_INI_SYSTEM
xcache.slots8KPHP_INI_SYSTEM
xcache.ttl0PHP_INI_SYSTEM
xcache.gc_interval0PHP_INI_SYSTEM
xcache.cacherOnPHP_INI_ALL
xcache.statOnPHP_INI_ALL
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.shm_scheme string
How XCache get shared memory
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.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.size int
Total amount of memory used for opcode (*.php) caching. If set to 0 - opcode caching is disabled. K M G modifiers can be used, i.e. 1G 512M 1024K
xcache.count int
Specify how many chunks to split the cache. Each chunk will use xcache.size/xcache.count amount of memory. 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.cacher boolean
Enable or disable opcode cacher. Not available if xcache.size is 0.
xcache.stat boolean
Do stat() to check if file updated.
xcache.var_size int
Total amount of memory used for variable caching. If set to 0 - variable caching is disabled. K M G modifiers can be used, i.e. 1G 512M 1024K
xcache.var_count int
Specify how many chunks to split the cache. Each chunk will use xcache.var_size/xcache.var_count amount of memory. See SplittedCache for details.
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 Optimizer

NameDefaultChangeable
xcache.optimizerOffPHP_INI_ALL
xcache.optimizer boolean
Enable optimizer.

XCache Coverager

NameDefaultChangeable
xcache.coveragerOffPHP_INI_PERDIR
xcache.coverager_autostartOffPHP_INI_PERDIR
xcache.coveragedump_directory"/tmp/pcov/"PHP_INI_SYSTEM
xcache.coverager boolean
Enable coverage data collecting required by xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt executing performance)
xcache.coverager_autostart boolean
Auto call xcache_coverager_start() on each request
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