I am trying to get an existing site upgraded to PHP 7.1 from 5.6 on Acquia. I needed to update the memcache module to the latest version (2.0-alpha4) as part of the process. In the documentation (https://docs.acquia.com/acquia-cloud/known-issues) it mentioned that memcache would be deprecated for 7. I'm currently using the SAML library 1.14.16 and am getting this error:

php-error staging-19842 [29-Sep-2017 10:40:15 America/Chicago] Uncaught PHP Exception Exception: "Missing Memcache class. Is the memcache extension installed?" at /.../.../.../.../vendor/simplesamlphp/simplesamlphp/lib/SimpleSAML/Memcache.php line 297 request_id="v-84e8d976-a52c-11e7-afe5-063f2feb7b10"

Any help would be greatly appreciated.

Comments

kkambeya created an issue. See original summary.

yojohnyo’s picture

We encountered this same problem. As a workaround we switched from using memcache to store session information to use the database.

kkambeya’s picture

Using the database isn't an option for this project. I was able to do a workaround. Here's what I did:

1) Add the commits from https://github.com/simplesamlphp/simplesamlphp/pull/395/files/5880a72f2f...

2) Change lines 296-301 of simplesamlphp/lib/SimpleSAML/Memcache.php to:

if (!class_exists('Memcached')) {
throw new Exception('Missing Memcache class. Is the memcache extension installed?');
}

// create the Memcache object
$memcache = new Memcached();

FROM

if (!class_exists('Memcache')) {
throw new Exception('Missing Memcache class. Is the memcache extension installed?');
}

// create the Memcache object
$memcache = new Memcache();

I'm not sure if its the best approach but it does work. Which makes me believe the issue is not with the module.

camoa’s picture

Checking on this issue:

PHP 7.1 has deprecated the php-memcache module in favor of the php-memcached, this causes the simplesamlphp library to crash on any release of version 1.14.

This issue was fixed for SimpleSAMLPHP v. 1.15(any of the RC) but this brought another issue:

in the SImpleSAMLPHPAuthManager.php file we have this:

  /**
   * {@inheritdoc}
   *
   * @param ConfigFactoryInterface $config_factory
   *   The configuration factory.
   * @param SimpleSAML_Auth_Simple $instance
   *   SimpleSAML_Auth_Simple instance.
   * @param SimpleSAML_Configuration $config
   *   SimpleSAML_Configuration instance.
   */
  public function __construct(ConfigFactoryInterface $config_factory, SimpleSAML_Auth_Simple $instance = NULL, SimpleSAML_Configuration $config = NULL) {
    $this->checkLibrary();
    $this->config = $config_factory->get('simplesamlphp_auth.settings');
    if (!$instance) {
      $auth_source = $this->config->get('auth_source');
     <strong> $this->instance = new SimpleSAML_Auth_Simple($auth_source);</strong>
    }
    else {
      $this->instance = $instance;
    }

    if (!$config) {
      $this->simplesamlConfig = \SimpleSAML_Configuration::getInstance();
    }
    else {
      $this->simplesamlConfig = $config;
    }
  }

Problem is V1.15 of the library renamed this class to Simple and this is causing issues now on the Drupal side.

camoa’s picture

dakku’s picture

Can you try RC6?

dakku’s picture

Status: Active » Postponed (maintainer needs more info)
anavarre’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Just would like to report it's been months and the module works great with PHP 7.1 now. I think we can safely close this.