Frequently Asked Questions
- Where to get help?
- Why XCache?
- Where Is ./configure?
- How to install from source?
- What if i'm getting "undefined symbol"
- Apache2 keeps getting segmentation faults with cache larger than 4M
- I get "Cannot dynamically load xcache.so"
- Why is misses > 0 no matter how I increase the shm size?
- Why is my cache being cleared?
- I see random "hits" in admin page
- Help! I get an error about "XCache requires Zend Engine API version NNN"
- xcache.so: undefined symbol: OnUpdateLong?
- xcache.so: undefined symbol: core_globals_id
- I got error: * is incompatible with XCache n Unknown on line 0
- I have read that xcache.optimizer setting gives an important performance …
Frequently Asked Questions
Where to get help?
Where Is ./configure?
Well... you have to install php first, which gives you "phpize" executable(script), and do
~/src/xcache $ phpize (generating configure) ~/src/xcache $ ./configure --help ~/src/xcache $ ./configure --enable-...
How to install from source?
What if i'm getting "undefined symbol"
If your php is configured --enable-versioning, disable it. It's broken. If you insist on versioning, build XCache as a static module of php.
Apache2 keeps getting segmentation faults with cache larger than 4M
Set "xcache.readonly_protection = On" in php.ini
I get "Cannot dynamically load xcache.so"
When u get PHP Warning: Unknown(): Cannot dynamically load xcache.so - dynamic modules are not supported in Unknown on line 0, it's because your php is running on a arch/os that don't support dynamic load library(aka modules), to solve it:
build as static module
~ $ mv xcache php-src/ext/ ~ $ cd php-src/ ~/php-src $ ./buildconf --force ~/php-src $ ./config.nice --enable-xcache --enable-xcache-coverager (or if you havn't run configure yet, use:) ~/php-src $ ./configure --enable-xcache --enable-xcache-coverager --your-options ~/php-src $ make all ~/php-src $ make install
Why is misses > 0 no matter how I increase the shm size?
"Misses" a opp to "hits". You get cache misses when there is nothing in the cache (i.e. the first time the cache gets hit.) Once it is cached and you start getting cache hits instead. So there shall be at least one miss per .php cached: misses=count(cached-php).
Why is my cache being cleared?
Set PHP_FCGI_CHILDREN to 1 or greater if you're using php FastCGI. (Not supported by Windows version of php-cgi.exe)
And see the following.
I see random "hits" in admin page
It is possible that "hits" count looks like random number in admin page. i.e.: you see hits=300,000 on first load of admin page, but dropped to hits=1 in 2nd reload and back to hits=312,456 on 3rd load.
This is because you have php started in different groups which do not share shm with each other. But keep in mind that all children in one group will share shm. So how to check and make it 1 group only?
$ pstree -p | |-supervise(4913)---lighttpd(23975)-+-php-cgi(23979)-+-php-cgi(23981) | | | |-php-cgi(23982) | | | |-php-cgi(23983) | | | `-php-cgi(23984)
$ pstree -p | |-supervise(4913)---lighttpd(23975)-+-php-cgi(23979)-+-php-cgi(23981) | | | |-php-cgi(23982) | | | |-php-cgi(23983) | | | `-php-cgi(23984) | +-php-cgi(23980)-+-php-cgi(23985) | | | |-php-cgi(23986) | | | |-php-cgi(23987) | | | `-php-cgi(23988)
Help! I get an error about "XCache requires Zend Engine API version NNN"
XCache requires Zend Engine API version 220051025. The Zend Engine API version 220060519 which is installed, is newer. Contact mOo at http://xcache.lighttpd.net for a later version of XCache.
You get this error because you have an outdated build of XCache. i.e., you upgraded php
Read next faq.
xcache.so: undefined symbol: OnUpdateLong?
Read next faq.
xcache.so: undefined symbol: core_globals_id
It can be *_globals_id or *_id. This error means XCache was built with the wrong PHP headers (the include/php/*.h files), either it was the wrong version or the wrong PHP build option, like 4.x vs 5.x or PHP zts build vs non-zts build. Apparently it can easily be fixed by removing the wrong headers and rebuilding XCache.
- Remove wrong PHP headers PHP headers can be php-devel package on some system, simply reinstall or upgrade it. But if your php is installed manually, try:
Remove PHP headers manually
(updatedb is optional if it's up to date already) # updatedb # locate include/php/main /usr/lib64/php5/include/php/main /usr/lib64/php5/include/php/main/build-defs.h /usr/lib64/php5/include/php/main/php_scandir.h /usr/lib64/php5/include/php/main/php_regex.h ...... (now, remove them) # rm -rf /usr/lib64/php5/include/php/ # rm -rf /usr/local/include/php...... # cd php (Reinstall the right php headers, using make) php # make install (or using apt-get install php5-dev, or however you install your php) php # apt-get install php5-dev
- Rebuild XCache with the right php headers
$ cd xcache $ make distclean $ phpize --clean $ phpize $ ./configure --enable-... && make $ su # make install
I got error: * is incompatible with XCache n Unknown on line 0
Use zend_extension=/path/to/xcache.so or zend_extension_ts=..., and make sure it's before any other zend_extension=... (This note is only validate before 3.0)
I have read that xcache.optimizer setting gives an important performance gain. Is that true ?
Currently only the "cacher" and "coverager" modules are implemented, tested and known to be working, the "optimizer" does nothing. it will be available only in XCache version 2, which is in an early development stage.