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

XF 1.2 Server Error Log is showing ErrorException: Fatal Error: XCache: Cannot create shm - Unknown:0

Discussion in 'Troubleshooting and Problems' started by DomainArchitect.com, Jan 23, 2014.

  1. DomainArchitect.com

    DomainArchitect.com Active Member

    Can anyone shed light on what might cause this error in the server error log?:
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    This implies a misconfiguration of XCache, what are your configuration values?
     
  3. santamo

    santamo Active Member

    I also have similar mistake. I did not change any settings.

    Where you can see the settings?

    ErrorException: Fatal Error: XCache: Cannot init - Unknown:0
    Сгенерирована пользователем: Неизвестная учётная запись, минуту назад
    Трассировка стэка

    #0 [internal function]: XenForo_Application::handleFatalError()
    #1 {main}

    Содержимое запроса

    array(3) {
    ["url"] => string(98) "http://forum.xxx.su/threads/nizhnekamskie-verujuschie-otmetili-rozhdestvo.476/calendar-remove"
    ["_GET"] => array(0) {
    }
    ["_POST"] => array(0) {
    }
    }


    config.php:

    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';

    #$config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
    'compression' => false,
    'servers' => array(
    array(
    // your memcached server IP /address
    'host' => 'localhost',

    // memcached port
    'port' => 11211,
    )
    )
    );



    #$config['cache']['cacheSessions'] = true;

    $config['cache']['backend'] = 'File';

    #$config['debug'] = true;
     
    Last edited: Feb 1, 2014
  4. MattW

    MattW Well-Known Member

    We need to see your Xcache settings. Those are the config settings for XenForo (also, you are trying to use Memcache, but you've commented out the actual part which sets it as your backend cache).
     
  5. santamo

    santamo Active Member

    Web hosting wrote:
    Xcache is installed on the hosting, but it's only used for caching byte-code PHP, access for storing user data, it is closed. To store arbitrary data use Memcache, which is also available on the server.
    Perhaps Your CMS tries to use Xcache but since there is authorization is required then an error is generated.
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Right now you are using the File cache backend which simply stores cached data in the file system. That works.

    If you wish to use Memcached then see this document:

    http://xenforo.com/help/cache/

    In all, to use Memcached for XF's cached data you need to add this code to the library/config.php file:

    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
    
    $config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
    	'compression' => false,
    	'servers' => array(
    		array(
    			// your memcached server IP /address
    			'host' => 'localhost',
    			
    			// memcached port
    			'port' => 11211,
    		)
    	)
    );
    
    A memory cache (such as Memcached) can speed things up. But be sure to monitor the cache. An unhealthy memory cache can actually be a detriment. A memory cache is really only appropriate for large / busy forums on a dedicated server with a server admin to configure it.

    Besides a memory cache, using an opcode cache like APC is a benefit to all forums and will speed up execution by way of having it installed on the server without any configuration in XF itself.
     
    santamo likes this.
  7. DomainArchitect.com

    DomainArchitect.com Active Member

    Getting this error:
    Code:
    Error Info
    ErrorException: Fatal Error: XCache: Cannot create shm - Unknown:0
    Generated By: Unknown Account, 4 minutes ago
    Stack Trace
    #0 [internal function]: XenForo_Application::handleFatalError()
    #1 {main}
    Request State
    array(3) {
      ["url"] => string(69) "URL/community/admin.php?login/csrf-token-refresh"
      ["_GET"] => array(1) {
        ["login/csrf-token-refresh"] => string(0) ""
      }
      ["_POST"] => array(3) {
        ["_xfRequestUri"] => string(20) "/community/admin.php"
        ["_xfNoRedirect"] => string(1) "1"
        ["_xfResponseType"] => string(4) "json"
      }
    }

    My config file:
    Code:
    <?php
    
    $config['db']['host'] = 'localhost';
    $config['db']['port'] = '3306';
    $config['db']['username'] = 'fo1_user';
    $config['db']['password'] = 'pw';
    $config['db']['dbname'] = 'fo1_db';
    
    $config['superAdmins'] = '1';
    

    Not sure that I actually need caching. This is not going to be a full blown site. Even when I add the following line, I get the error:

    $config['cache']['enabled'] = false;
     
  8. Tracy Perry

    Tracy Perry Well-Known Member

    Is xCache configured in PHP? What does your php info page show for it? Sounds like it's not fully configured.
     
  9. DomainArchitect.com

    DomainArchitect.com Active Member

    Is xCache necessary to run XF? If not, how do I disable it?
     
  10. Tracy Perry

    Tracy Perry Well-Known Member

    Nope, it's not really - especially if you are using the latest PHP and have enabled the built in op code cache.
    Just comment out all the cache related entries in your config.php.
     
  11. MattW

    MattW Well-Known Member

    What settings do you have in your php.ini for Xcache? That error is suggesting Xcache can't set it's shared memory space for caching.
     
    Tracy Perry likes this.
  12. DomainArchitect.com

    DomainArchitect.com Active Member

    This is my config:
    Code:
    <?php
    
    $config['db']['host'] = 'localhost';
    $config['db']['port'] = '3306';
    $config['db']['username'] = 'fo1_user';
    $config['db']['password'] = 'pw';
    $config['db']['dbname'] = 'fo1_db';
    
    $config['superAdmins'] = '1';
     
  13. Tracy Perry

    Tracy Perry Well-Known Member

    Are you running any add-ons that use a cache?
    That error indicates that something is expecting xCache to be loaded. Are you using memcached on the server? If so, try restarting your web server and php.
     
  14. DomainArchitect.com

    DomainArchitect.com Active Member

    No, I even disabled the addons and still get the error.
     
  15. Tracy Perry

    Tracy Perry Well-Known Member

    OK, have you at any time had xCache installed on the server? If so, have you restarted Apache (if that's what you use, otherwise php5-fpm if using nginx) or OLS/LS if using OpenLiteSpeed or LiteSpeed?
     
  16. DomainArchitect.com

    DomainArchitect.com Active Member

    I am on litespeed and xcache is running as well as memcache. This is with wiredtree. When they make changes to xcache, it affects other websites on the server so I think they might be using it. any idea how you would address this?
     
  17. Tracy Perry

    Tracy Perry Well-Known Member

    OK.. you are on a shared hosting package apparently?
    Does your php info page show xCache being loaded?
    yourdmain.com/admin.php?tools/phpinfo
     
  18. DomainArchitect.com

    DomainArchitect.com Active Member

    I use a dedicated server. Shows memcache but no xcache
     
  19. Tracy Perry

    Tracy Perry Well-Known Member

    Have you at ANY time had xCache enabled in your config.php?
    Have you restarted the LiteSpeed server since you took it out (if you had it there)?
     
  20. MattW

    MattW Well-Known Member

    If you are on a dedicated server, locate your php.ini file, and search for ANY values which reference Xcache in there.
     
    lsmichael likes this.

Share This Page