diff --git a/src/admin/prefs.common.php b/src/admin/prefs.common.php index 4b7c019..6aee78f 100644 --- a/src/admin/prefs.common.php +++ b/src/admin/prefs.common.php @@ -192,7 +192,12 @@ else if($_REQUEST['action'] == 'caching') // assign $bm_prefs['memcache_servers'] = str_replace(';', "\n", $bm_prefs['memcache_servers']); - $tpl->assign('memcache', class_exists('Memcache') || class_exists('Memcached')); + if((int)str_replace('.', '', phpversion()) >= 800) { // In PHP 8 we will disable memcached + $tpl->assign('memcache', false); + } + else { + $tpl->assign('memcache', class_exists('Memcache') || class_exists('Memcached')); + } $tpl->assign('page', 'prefs.caching.tpl'); } diff --git a/src/serverlib/cache.class.php b/src/serverlib/cache.class.php index e102e55..d6fbf77 100644 --- a/src/serverlib/cache.class.php +++ b/src/serverlib/cache.class.php @@ -353,7 +353,13 @@ class BMCache_memcache extends BMCache $memcacheServers = explode(';', $bm_prefs['memcache_servers']); if(class_exists('Memcache') || class_exists('Memcached')) { - if(count($memcacheServers) > 0 && trim($memcacheServers[0]) != '') + if((int)str_replace('.', '', phpversion()) >= 800) { // In PHP 8 we will disable memcached + PutLog('PHP 8 or higher detected. memcache is disabled. Please choose an other cache method or contribute your code changes to the community.', + PRIO_WARNING, + __FILE__, + __LINE__); + } + else if(count($memcacheServers) > 0 && trim($memcacheServers[0]) != '') { if(class_exists('Memcache')) {