Unable to make Memcache work on PHP 7.0

I am running Elgg-2.3.12, and no matter what I am unable to make memcache work on PHP 7.0 and 7.2 . In both php 7.0 and 7.2 only extension = memcached.so extension is loaded. If I fall back to php 5.6 , I see both extension = memcache.so, extension = memcached.so extensions are loaded, and memcache stats workings and shows up under Statistics : Server Info.

Is anyone having same issue?

 

  • does it mean memcached interexchanged with memcache ? otherwise speaking are you trying to say that memcached=memcache ? I think what are u r saying is memcached can not be quantified  memcache  as they are different. 

    So, will the following in setting.php solve 

    $CONFIG->memcache = true;
    //
    $CONFIG->memcache_servers = array (
    array('127.0.0.1', 11211),
    array('198.23.48.101', 11211)
    );
     
    // namespace prefix
    $CONFIG->memcache_namespace_prefix = 'memcache.so';
     
    $CONFIG->memcached = true;
    $CONFIG->memcached_servers = array (
    array('127.0.0.1', 11211),
    array('198.23.48.101', 11211)
    );
     
    // namespace prefix
    $CONFIG->memcache_namespace_prefix = 'memcached.so';
  • You need PHP extension php-memcached and memcached server only.

    In Elgg settings.php use:

    $CONFIG->memcache = true;
    
    $CONFIG->memcache_servers = array (
        array('localhost', 11211),
    );
    
    // Namespace prefix means some name if you use multiple sites on your server​
    $CONFIG->memcache_namespace_prefix = 'site_name';

    Please, read how to install PHP 7 with memcached.

    And Elgg docs also.

    are you trying to say that memcached=memcache ?

    These are different extensions (modules).

    != means NOT

  • I have had tried in past declaring singly array, but it didn't produce any result nor did it with exact as per your above declaration. As far as the server is concerned, Memcache is correctly installed in VPS server for 7.0 including 7.2.

    Its just not working for elgg... with php 7 + ... the core script does't work as intended..... and so is the redis.... just sad!

     

    <?php
     
    global $CONFIG;
     
    if (!isset($CONFIG)) {
    $CONFIG = new \stdClass;
    }
     
    // Memcached configuration for Travis
    $CONFIG->memcache = true;
    $CONFIG->memcache_servers = [
    ['127.0.0.1', 11211],
    ];
    $CONFIG->memcache_namespace_prefix = 'elgg_';
    this "elgg_" looks like to be db prefix. what is it doing in core memcache script?
  • I have had tried in past declaring singly array, but it didn't produce any result nor did it with exact as per your above declaration. As far as the server is concerned, Memcache is correctly installed in VPS server for 7.0 including 7.2.

    Its just not working for elgg... with php 7 + ... the core script does't work as intended..... and so is the redis.... just sad!

     

    <?php
     
    global $CONFIG;
     
    if (!isset($CONFIG)) {
    $CONFIG = new \stdClass;
    }
     
    // Memcached configuration for Travis
    $CONFIG->memcache = true;
    $CONFIG->memcache_servers = [
    ['127.0.0.1', 11211],
    ];
    $CONFIG->memcache_namespace_prefix = 'elgg_';
    this "elgg_" looks like to be db prefix. what is it doing in core memcache script?