diff --git a/includes/static-config.php b/includes/static-config.php index db337d20a..bd17f194c 100644 --- a/includes/static-config.php +++ b/includes/static-config.php @@ -1134,11 +1134,19 @@ if (!$observium_link) } $observium_db = mysql_select_db($config['db_name'], $observium_link); -if($config['memcached']['enable']) +if ($config['memcached']['enable']) { - $memcache = new Memcached(); - $memcache->addServer($config['memcached']['host'], $config['memcached']['port']); - if ($debug) { print_r($memcache->getStats()); } + if (class_exists("Memcached")) + { + $memcache = new Memcached(); + $memcache->addServer($config['memcached']['host'], $config['memcached']['port']); + if ($debug) { print_r($memcache->getStats()); } + } + else + { + echo("WARNING: You have enabled memcached but have not installed the PHP bindings. Disabling memcached support.\n"); + $config['memcached']['enable'] = 0; + } } # Set some times needed by loads of scripts (it's dynamic, so we do it here!)