1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XCache errors and troubles

Discussion in 'Server Configuration and Hosting' started by Ocean44, Dec 1, 2014.

  1. Ocean44

    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
     

    Attached Files:

  2. Brogan

    Brogan XenForo Moderator Staff Member

    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?
     
  3. Ocean44

    Ocean44 Member

    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.
     
    Ha3 likes this.
  4. Ocean44

    Ocean44 Member

    I don't see anything related in CPanel > Error Log
    Should I be looking somewhere else?
     
  5. Tracy Perry

    Tracy Perry Well-Known Member

    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.
     
    Ha3 likes this.
  6. Ocean44

    Ocean44 Member

    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.
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
  8. Tracy Perry

    Tracy Perry Well-Known Member

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

    Ocean44 Member

    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. ;)

    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
     
    Ha3 likes this.
  10. Moshe1010

    Moshe1010 Well-Known Member

    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.
     
  11. Ocean44

    Ocean44 Member

    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?
     
  12. Moshe1010

    Moshe1010 Well-Known Member

    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
     
  13. Ocean44

    Ocean44 Member

    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.
     
    MattW likes this.
  14. Moshe1010

    Moshe1010 Well-Known Member

    I would suggest libmemcached. Received better results with my testing (15% better on average).
     
    Insy likes this.

Share This Page