SimpleSAMLphp and memcache

1,455 views
Skip to first unread message

Blaž Divjak

unread,
Jun 4, 2015, 2:16:24 AM6/4/15
to simple...@googlegroups.com
Hi!

I would like to configure SimpleSAMLphp with memcache. I have followed the instructions on https://simplesamlphp.org/docs/1.13/simplesamlphp-maintenance#section_2

I have installed the following packages on the web server running SimpleSAMLphp
- php-pecl-memcache-3.0.8-4.el7.remi.5.5.x86_64
- php-pecl-memcached-2.2.0-3.el7.remi.5.5.x86_64

I have added the following lines to SimpleSAMLphp's config.php
       'store.type' => 'memcache',
       'memcache_store.servers' => array(
               array(
                       array('hostname' => 'memcache.TEST.TLD'),
               ),
       ),
        'memcache_store.expires' =>  8 * (60*60), // 8 hours.

The log shows
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] Error loading session: Missing Memcache class. Is the memcache extension installed?
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 7 [XXXXXXXXXX] Session: 'default-sp' not valid because we are not authenticated.
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 7 [XXXXXXXXXX] Saved state: '_76956643535bc891f84a3a53fce0725f7796d16791:http://webpage.TEST.TLD/simplesaml/module.php/core/as_login.php?AuthId=default-sp&ReturnTo=http.TEST.TLD-login.php.TEST.TLD-admin-sites.php'
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] Unable to save session.
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] Exception: Missing Memcache class. Is the memcache extension installed?
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] Backtrace:
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] 6 /opt/simplesaml/simplesamlphp-1.13.2/lib/SimpleSAML/Memcache.php:253 (SimpleSAML_Memcache::loadMemcacheServerGroup)
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] 5 /opt/simplesaml/simplesamlphp-1.13.2/lib/SimpleSAML/Memcache.php:333 (SimpleSAML_Memcache::getMemcacheServers)
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] 4 /opt/simplesaml/simplesamlphp-1.13.2/lib/SimpleSAML/Memcache.php:133 (SimpleSAML_Memcache::set)
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] 3 /opt/simplesaml/simplesamlphp-1.13.2/lib/SimpleSAML/Store/Memcache.php:49 (SimpleSAML_Store_Memcache::set)
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] 2 /opt/simplesaml/simplesamlphp-1.13.2/lib/SimpleSAML/SessionHandlerStore.php:81 (SimpleSAML_SessionHandlerStore::saveSession)
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] 1 /opt/simplesaml/simplesamlphp-1.13.2/lib/SimpleSAML/Session.php:182 (SimpleSAML_Session::__destruct)
Jun  3 16:42:38 webnode1 simplesamlphp[2394]: 3 [XXXXXXXXXX] 0 [builtin] (N/A)

What is missing and how can I get memcache to work with SimpleSAMLphp?

Kind regards,
Mitja

Ian Tegebo

unread,
Jun 4, 2015, 12:07:42 PM6/4/15
to simple...@googlegroups.com
Is the memcache PHP extension configured for the php interpreter running for your SimpleSAMLphp installation?


Also, maybe you're missing zlib:

Mitja Mihelič

unread,
Jun 5, 2015, 9:42:41 AM6/5/15
to simple...@googlegroups.com
Thanks to Blaž for forwarding my initial query.

In the end it was the absence of the zlib package that was causing the problem.

Since the Memcache class is said to be deprecated in the memcache module API since v3.0., I have also tried using the MemcachePool class instead of Memcache. It works with a tweak to input parameters for $memcache->addServer, zlib is also required.

Regards, Mitja
--
You received this message because you are subscribed to the Google Groups "simpleSAMLphp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simplesamlph...@googlegroups.com.
To post to this group, send email to simple...@googlegroups.com.
Visit this group at http://groups.google.com/group/simplesamlphp.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages