Opened 15 months ago
Closed 11 months ago
#1488384 closed Bugs (worksforme)
Roundcube Webmail setup for memcache session storage
| Reported by: | kacanski | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.8-stable |
| Component: | Core functionality | Version: | git-master |
| Severity: | normal | Keywords: | memcache |
| Cc: |
Description (last modified by alec)
Tried to setup in different ways memcache but nothing works
Roundcube Webmail 0.8-svn [SVN r5959]
$rcmail_config['session_storage'] = 'memcache';
// Use these hosts for accessing memcached
// Define any number of hosts in the form hostname:port
//$rcmail_config['memcache_hosts'] = 'localhost:11211'; // e.g. array( 'localhost:11211', '192.168.1.12:11211' );
$rcmail_config['memcache_hosts'] = array('localhost:11211');
memcached -d -l localhost -p 11211 -u memcached -m 64 -c 1024 -P /var/run/memcached/memcached.pid
telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
[06-Mar-2012 16:55:51 -0500]: DB Error: Failed to connect to memcached. Please check configuration in /var/www/rcube/program/include/rcube_ses
sion.php on line 82 (GET /rcube/?_task=mail&_action=check-recent&_mbox=INBOX&_list=1&_remote=1&_unlock=0&_=1331070951740)
code :
66 // use memcache backend
67 if ($config->get('session_storage', 'db') == 'memcache') {
68 $this->memcache = rcmail::get_instance()->get_memcache();
69
70 // set custom functions for PHP session management if memcache is available
71 if ($this->memcache) {
72 session_set_save_handler(
73 array($this, 'open'),
74 array($this, 'close'),
75 array($this, 'mc_read'),
76 array($this, 'mc_write'),
77 array($this, 'mc_destroy'),
78 array($this, 'gc'));
79 }
80 else {
81 raise_error(array('code' => 604, 'type' => 'db',
82 'line' => __LINE__, 'file' => __FILE__,
83 'message' => "Failed to connect to memcached. Please check configuration"),
84 true, true);
85 }
thanks --sasha
Change History (8)
comment:1 Changed 15 months ago by thomasb
comment:2 Changed 14 months ago by alec
- Description modified (diff)
- Milestone changed from later to 0.8-rc
- Resolution set to worksforme
- Status changed from new to closed
No feedback.
comment:3 Changed 14 months ago by sthen
I recently tried to configure Roundcube to use Memcache session storage and hit this problem and tracked down one cause; some versions of the Memcache extension (e.g. 3.0.4) are buggy (issuing "delete <key> 1" which is incorrect syntax, at least for Memcached 1.4.13). This gives exactly this problem when used for session storage (though it does work OK for imap caching).
Since upgrading the Memcache extension to 3.0.6 memcache sessions are now working fine.
comment:4 follow-up: ↓ 7 Changed 11 months ago by bobleponge
Even with the last extension (3.0.6) in beta, and last release candidate of RC (0.8-rc), this still happens.
comment:5 Changed 11 months ago by bobleponge
- Resolution worksforme deleted
- Status changed from closed to reopened
comment:6 Changed 11 months ago by alec
- Description modified (diff)
- Milestone changed from 0.8-rc to 0.8-stable
comment:7 in reply to: ↑ 4 Changed 11 months ago by thomasb
Replying to bobleponge:
Even with the last extension (3.0.6) in beta, and last release candidate of RC (0.8-rc), this still happens.
What exactly "still happens"? That you can't connect to memcache at all? That definitely works if PHP is properly configured and isn't a Roundcube issue.
comment:8 Changed 11 months ago by alec
- Resolution set to worksforme
- Status changed from reopened to closed
Works for me too, php5-memcache-3.0.6-1, memcached-1.4.13-0ubuntu2.

Works for me. Do you have the Memcache extension for PHP installed? Use http://code.google.com/p/phpmemcacheadmin/ to test the PHP connection to memcache outside of Roundcube.