XCache errors and troubles

Ocean44

Member
I'm trying to use XCache with my forums.
The host says it is present and enabled and I can see it in phpinfo.

When xcache is not in my enabled in my config file I'm getting several of these errors per minute in the server error log

ErrorException: Fatal Error: XCache: Cannot init - Unknown:0
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}

When I add
$config['cache']['backend'] = 'Xcache';
to the config file, I get a white page

An unexpected error occurred. Please try again later.

A screenshot of the XCache admin panel is attached.



How can I troubleshoot this problem?
Thanks
 

Attachments

  • xcache screenshot.webp
    xcache screenshot.webp
    56.8 KB · Views: 15
Xcache is an opcode cache so you don't need to set anything in config.php.

Is there anything in the server error log which may shed some more light on the error?
Have you tried restarting PHP/Apache?
 
Xcache is an opcode cache so you don't need to set anything in config.php.

I've read that here, but why does the setting in config.php change the problem from server log error to white screen?

I'm using LiteSpeed which has been restarted. Not sure about how to restart PHP.
I'll go try to find an error log.
 
  • Like
Reactions: Ha3
I've read that here, but why does the setting in config.php change the problem from server log error to white screen?

I'm using LiteSpeed which has been restarted. Not sure about how to restart PHP.
I'll go try to find an error log.
If you are using LiteSpeed and the newer compile of PHP, why are you using xCache for opcode caching? Just use the built in opcode caching in PHP 5.5.x series.
 
  • Like
Reactions: Ha3
PHP Version 5.4.32

Actually I didn't know I was using Xcache with Xenforo until it started showing 5000 server errors per day. Which happened after my host changed
xcache.size from 64M to 160M . That seemed to fix a problem where XF could not finish generating sitemaps. (I have a thread here on that)

I figured configuring XCache correctly would fix the "ErrorException: Fatal Error: XCache: Cannot init - Unknown:0" errors from XF.
 
Xcache is nothing to do with XenForo though.
It's an opcode cache for caching PHP.

Whatever issues you are having with it will be due to the xcache configuration.
 
Also, are you running any add-ons that may depend on xCache being loaded (possibly XenCache)?
 
Whatever issues you are having with it will be due to the xcache configuration.

That is what I figured. I was hoping the problem might ring a bell with someone here. The host tells me XCache is enabled(see the screenshot).
I'm not a server admin, just an XF user hoping to run it the speedily. ;)

Also, are you running any add-ons that may depend on xCache being loaded (possibly XenCache)?

No XenCache
only these
Add Skimlinks Code 1.4.0
******* - Auto Link Replacer 1.6.5
Ebay Parser 1.2
ForumRunner for XenForo 1.1.4
Tagged Users in User Group Color 1.0.0
Tapatalk 2.3.4
XenForo Media Gallery 1.0.0
[bd] Rotating Ads 2.0
[bd] Widget Framework 2.5.9
 
  • Like
Reactions: Ha3
It's an opcode cache for caching PHP.
It's a variable cache as well.

The attached screenshot says nothing about how much memory you actually use from whatever is configured. it should look like this:
http://i1-scripts.softpedia-static.com/screenshots/XCache_1.png

Copy-paste your php.ini and the xCache relevant section.
This was my config.php back in the days (I don't use xcache anymore and prefer PHP's 5.5 Opcahce+libmemcached):

$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_prefix';
$config['cache']['backend'] = 'xCache';
$config['cache']['cacheSessions'] = true;

Don't cache sessions until you solve your problem because it can make a mess, but in terms of performance this makes some difference.
 
The attached screenshot says nothing about how much memory you actually use from whatever is configured. it should look like this:
http://i1-scripts.softpedia-static.com/screenshots/XCache_1.png

That page on my XCache panel has no data, just the headings.

all xcache from php.ini
extension="xcache.so"
xcache.admin.enable_auth="Off"
xcache.admin.pass=""
xcache.admin.user=""
xcache.cacher="On"
xcache.coredump_directory=""
xcache.count="8"
xcache.coveragedump_directory=""
xcache.coverager="Off"
xcache.gc_interval="0"
xcache.mmap_path="/dev/zero"
xcache.optimizer="On"
xcache.readonly_protection="Off"
xcache.shm_scheme="mmap"
xcache.size="160M"
xcache.slots="8K"
xcache.stat="Off"
xcache.test="Off"
xcache.ttl="0"
xcache.var_count="1"
xcache.var_gc_interval="300"
xcache.var_maxttl="0"
xcache.var_size="32M"
xcache.var_slots="8K"
xcache.var_ttl="0"

I have the same in my config.php file except I have commented out
"$config['cache']['backend'] = 'xCache';" otherwise my forum goes down with "An unexpected error occurred. Please try again later." and white page.
By the way, is 'xcache' case insensitive on that line?
 
If there is no data as I showed, it means that xcache is not installed correctly on the server. Refer to your host to reinstall xcache. And no it doesn't matter how you write xcache in config.pho
 
As was suggested here and by my host, we got rid of XCache and went with memcache and Zend Opcache.
There are no errors and all seems good.
Thanks to you all for the help.
 
Top Bottom