Exception: Missing Memcache class when using memcached

480 views
Skip to first unread message

Agnar Ødegård

unread,
Aug 4, 2016, 5:36:40 AM8/4/16
to SimpleSAMLphp
Hi, I'm running simplesamlphp on a server using memcache. On a new server I wanted to use memcached.

I've read mentions of using simplesamlphp with memcached, but the problem is in Memcache.php L:296 class_exists('Memcache') is false. Memcached (notice the d) exists though, but how can I use memcached when the class is created using memcache without d specifically?

Can't I use memcached? Is there a compatabilty layer I'm missing? phpinfo() shows memcached is loaded and fine. zlib too.

Thanks for any help.

Thijs Kinkhorst

unread,
Aug 4, 2016, 5:41:12 AM8/4/16
to simple...@googlegroups.com
Hi Agnar,
Unfortunately and confusingly there are two PHP modules for use with
memcached and the "d" is the difference in their naming:

php5-memcache - memcache extension module for PHP5
php5-memcached - memcached extension module for PHP5, uses libmemcached

I believe that installing the former of these should solve your problem.


Cheers,
Thijs

signature.asc

Agnar Ødegård

unread,
Aug 4, 2016, 5:45:59 AM8/4/16
to SimpleSAMLphp
Thanks for your reply. Yes, there is a lot of confusion between those two and I guess my problem can be solved by installing the older memcache. It's just that I've read memcacheD in the context of simplesamlphp several places and so I expected it to work. I guess I'll have to install memcache then.

Thijs Kinkhorst

unread,
Aug 4, 2016, 5:51:36 AM8/4/16
to simple...@googlegroups.com
On 04-08-16 11:45, Agnar Ødegård wrote:
> Thanks for your reply. Yes, there is a lot of confusion between those
> two and I guess my problem can be solved by installing the older
> memcache. It's just that I've read memcacheD in the context of
> simplesamlphp several places and so I expected it to work. I guess I'll
> have to install memcache then.

If you have concrete suggestions places to improve the documentation, or
indeed better/more explicit error handling in the source code those are
more than welcome! Ideally as a pull request...


Cheers,
Thijs

signature.asc

Agnar Ødegård

unread,
Aug 4, 2016, 5:59:02 AM8/4/16
to SimpleSAMLphp
Yes, I will do that. I wanted to make sure first that memcached won't work 100%. The code says so, but then, google found posts implying otherwise.

Ok, I'll make a pull request shortly.


On Thursday, August 4, 2016 at 11:36:40 AM UTC+2, Agnar Ødegård wrote:

Jaime Perez Crespo

unread,
Aug 4, 2016, 6:07:29 AM8/4/16
to simple...@googlegroups.com
Hei Agnar!

A quick search in the documentation yields only one result for “memcached”, that being the instructions on how to install the memcached server that you will need apart from PHP support. Those same instructions say quite explicitly that you need “php5-memcache”.

Apart from that, the rest of the documentation says “memcache”, as far as I can see. If you found any place where “memcached” is used in the documentation, please tell us.

On 04 Aug 2016, at 11:59 AM, Agnar Ødegård <agnar....@gmail.com> wrote:
> Yes, I will do that. I wanted to make sure first that memcached won't work 100%. The code says so, but then, google found posts implying otherwise.
>
> Ok, I'll make a pull request shortly.

--
Jaime Pérez
UNINETT / Feide
mail: jaime...@uninett.no
xmpp: ja...@jabber.uninett.no

"Two roads diverged in a wood, and I, I took the one less traveled by, and that has made all the difference."
- Robert Frost

Agnar Ødegård

unread,
Aug 4, 2016, 6:31:47 AM8/4/16
to SimpleSAMLphp
Ah, I see that I didn't quite understand the confusion myself. I though memcache had to be paired with php5-memcache, and memcached with php5-memcached... because... symmetry I guess.

OK, so I can use memcacheD togheter with php5-memcache (-D). Alright.


On Thursday, August 4, 2016 at 11:36:40 AM UTC+2, Agnar Ødegård wrote:
Reply all
Reply to author
Forward
0 new messages