• 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

#1
Can anyone shed light on what might cause this error in the server error log?:
Error InfoErrorException: Fatal Error: XCache: Cannot create shm - Unknown:0
Generated By: Admin, 3 minutes ago
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
["url"] => string(23) "http://mywebsiteurl.com/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 

santamo

Active member
#3
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:

MattW

Well-known member
#4
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;
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).
 

santamo

Active member
#5
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.
 

Jake Bunce

XenForo moderator
Staff member
#6
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.
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.
 
#7
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;
 

Tracy Perry

Well-known member
#10
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.
 

MattW

Well-known member
#11
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;
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.
 
#12
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.
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';
 

Tracy Perry

Well-known member
#13
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.
 

Tracy Perry

Well-known member
#15
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
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?
 

Tracy Perry

Well-known member
#17
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?
OK.. you are on a shared hosting package apparently?
Does your php info page show xCache being loaded?
yourdmain.com/admin.php?tools/phpinfo