Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

init_memcached(): only use pconnect if configured to do so

Make pconnections optional - only use pconnect if $CFG->memcachedpconn is
set. In current versions of the memcache client in PECL (v2.0.1),
memcache_pconnect() is buggy and will segfault if reusing a pconnection
to a server that has gone away or restarted.

And hope for a more stable client library in PECL ;-)
  • Loading branch information...
1 parent 419e1d9 commit 9c967c33fb78624d0f360b4a3cac684ea09a45a0 martinlanghoff committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/setuplib.php
4 lib/setuplib.php
@@ -219,9 +219,11 @@ function init_memcached() {
$hosts = split(',', $CFG->memcachedhosts);
$MCACHE = new Memcache;
- if (count($hosts) === 1) {
+ if (count($hosts) === 1 && !empty($CFG->memcachedpconn)) {
// the faster pconnect is only available
// for single-server setups
+ // NOTE: PHP-PECL client is buggy and pconnect()
+ // will segfault if the server is unavailable
} else {
// multi-host setup will share key space

0 comments on commit 9c967c3

Please sign in to comment.
Something went wrong with that request. Please try again.