[horde] Problem with XCache and Horde

Jens Grüntjes jens.gruentjes at ebira.de
Tue Apr 28 12:50:32 UTC 2015


Hello,

since I changed the PHP opcode cache from APC to XCache I'm running  
into problems with horde. Whenever horde-alarms is executed I receive  
an error message like:

Cannot write Autoloader cache to backend

Horde's log file then contains the following line:

2015-04-28T10:50:03+00:00 WARN: HORDE [horde] PHP ERROR: xcache_set():  
XCache var cache was not initialized properly. Check php log for  
actual reason [pid 2603 on line 155 of  
"/usr/share/php/Horde/Autoloader/Cache/Bootstrap.php"]

I can raise the error if I manually execute horde-alarms as well.

As I wrote in a previous post to the imp-list (subject was: [imp]  
Cannot write Autoloader cache to backend.), I tried/checked different  
things to find out what the reason is.

1) The directory /tmp is writable for the webserver

2) XCache is activated according to the output of phpinfo() and to the  
XCache admin page of my server

3) I tried to use XCache from inside horde, i.e. the PHP console:

$test = "Hello";
xcache_set("test", $test);

I see the variable test in XCache's admin-view with the value Hello.  
So it looks as if XCache is working from inside horde.

4) I tried using xcache from inside a website rather than from horde's  
console, and that works.

5) I put a log statement in  
/usr/share/php/Horde/Autoloader/Cache/Bootstrap.php like this:

public function set($key, $data)
     {
         $data = ($this->_mask & self::MSGPACK)
             ? msgpack_pack($data)
             : json_encode($data);

         if ($this->_mask & self::LZ4) {
             $data = @horde_lz4_compress($data);
         } elseif ($this->_mask & self::LZF) {
             $data = lzf_compress($data);
         }

         if ($this->_mask & self::APC) {
             return apc_store($key, $data);
         } elseif ($this->_mask & self::XCACHE) {
             error_log($key, 4);  // <---- Logging here
             error_log($data, 4); // <---- Logging here
             return xcache_set($key, $data);
         }
...
}

When I run horde-alarms from command line the message is triggered. I  
copied the output into a simple php-script:

<?php
$key = "horde_autoloader_cache_dcfe726a02a17964308e92a52484786c";
$val = "the_output_from_the_error_message";
$ret = xcache_set($key, $val);
var_dump($ret);
?>

This results in: "boolean true"


Can maybe someone with XCache running help me out?

--
Greetings
Jens



More information about the horde mailing list