(note: do not apply this patch on vBulletin 3.7 as it's included already)
This patch allow you to use XCache as a datastore cache in vBulletin. This is definitely your choice if you have installed and enabled XCache on you server already.
Take care that this is a beta version and was not heavily tested. And i'm not familiar with vBulletin source code as i just started reading it today, but i don't have any difficulty reading it thanks to my years of php skill
Take aware that some vB plugin is not compatible with vB_datastore_*, not just vB_datastore_XCache. So, in case you find vB_datastore_XCache won't work, you'd better try datastore to file or memcache. If one of the others works but not vB_datastore_XCache, do report it to me so i can fix it.
// vB_Datastore_Filecache - for using a cache file
// $config['Datastore']['class'] = 'vB_Datastore_Filecache';
$config['Datastore']['class'] = 'vB_Datastore_XCache';
// vB_Datastore_Memcached - for using a Memcache server
// It is also necessary to specify the hostname or IP address and the port the server is listening on
Trouble Shooting
q. i have multiple vBulletin instance installed, the seems to mix data after install this plugin
a. this applies to apc too because, if you wanna fix it, try
open class_core.php, look for:
$this->prefix =& $this->registry->config['Datastore']['prefix'];
and modify to:
$this->prefix = $this->registry->config['Datastore']['prefix'] . $_SERVER['SERVER_NAME']; // or HTTP_HOST
q. Warning: unserialize() expects parameter 1 to be string, array given in $a.php on line $b
a. upgrade your plugin/hack that $a.php belongs to, e.g. vbjournal/vbgallery etc. OR open $a.php and locate at line $b, remove unserialize call, e.g.:
replace $var = unserialize($this->data);
with $var = $this->data;
be careful do not remove the whole line, just the unseralize( and )
Warning: xcache_set() [function.xcache-set]: xcache.var_size is either 0 or too small to enable var data caching in /includes/class_datastore_xcache.php on line 124
; same as aboves but for variable cache
xcache.var_size = 4M
xcache.var_count = 1
xcache.var_slots = 8K
; default ttl
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
; N/A for /dev/zero
xcache.readonly_protection = Off
; for *nix, xcache.mmap_path is a file path, not directory.
; Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection
; 2 group of php won't share the same /tmp/xcache
; for win32, xcache.mmap_path=anonymous map name, not file path
xcache.mmap_path = "/dev/zero"
; leave it blank(disabled) or "/tmp/phpcore/"
; make sure it's writable by php (without checking open_basedir)
xcache.coredump_directory = "/tmp/phpcore/"
; per request settings
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
[xcache.coverager]
; per request settings
; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt executing performance)
xcache.coverager = Off
; ini only settings
; make sure it's readable (care open_basedir) by coverage viewer script
; requires xcache.coverager=On
xcache.coveragedump_directory = ""
how do you load xcache.so?
extension=xcache.so
OR
zend_extension=/path/to/xcache.so
try the other way
it was Zend_extension ( correct path ) , i remarked it with ;; and them removed ;; from extension=xcache.so . server restarted . this errors showed up :
Quote:
Fatal error: XCache not installed in /includes/class_datastore_xcache.php on line 34
Tried this out... Seemed to work great except some strange problems with vbjournal and photopost gallery (2.3 -- still problems with xcache datastore).
I had to disable it due to the plugin problems. If there was a guide on how to change plugins so they are compatible that might be helpful.