Simple Machines Community Forum

SMF Support => Server Performance and Configuration => Topic started by: spiros on January 17, 2022, 09:50:45 AM

Title: Memcached in php 8 SMF 2.0.19?
Post by: spiros on January 17, 2022, 09:50:45 AM
I have recently updated to php 8 and I have installed Memcached 1.5.16 but when I go to Server settings I see: SMF has not been able to detect a compatible accelerator on your server.
Title: Re: Memcached in php 8 SMF 2.0.19?
Post by: Arantor on January 17, 2022, 10:07:35 AM
memcache or memcached? The two are not equivalent (two different PHP extensions) and I don't think the newer one is supported by 2.0.
Title: Re: Memcached in php 8 SMF 2.0.19?
Post by: spiros on January 17, 2022, 10:21:44 AM
I had tested with memcached

memcached -h
memcached 1.5.16

SMF mentions in Server settings (erroneously?):

QuoteSMF supports caching through the use of accelerators. The currently supported accelerators include:
APC
APCu
eAccelerator
Turck MMCache
Memcached
Zend Platform/Performance Suite (Not Zend Optimizer)
XCache

I can see Memcache 8 being compatible with php 8:
Quote- Version 8.x support PHP 8.x
- Version 4.x supports PHP 7.0-7.4.
http://pecl.php.net/package/memcache/8.0

And Memcached also:

https://github.com/php-memcached-dev/php-memcached/issues/466
https://pecl.php.net/package-changelog.php?package=memcached
Title: Re: Memcached in php 8 SMF 2.0.19?
Post by: Arantor on January 17, 2022, 10:38:13 AM
And that's exactly the problem. Both client packages (memcache, memcached) call the same server package, also called memcached!

Observe the difference between https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Cache/APIs/MemcacheImplementation.php and https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Cache/APIs/MemcachedImplementation.php

2.0 only supports the former if I remember correctly, but I think you're using the latter.
Title: Re: Memcached in php 8 SMF 2.0.19?
Post by: spiros on January 17, 2022, 11:02:17 AM
So I should uninstall the other one or they can coexist? I wonder if anyone has it working on php 8.
Title: Re: Memcached in php 8 SMF 2.0.19?
Post by: Arantor on January 17, 2022, 11:24:39 AM
You can try installing the other, it might work. They should be able to coexist in theory but honestly... this nonsense is partly why I jumped to Redis a while ago so I didn't have to deal with this nonsense.
Title: Re: Memcached in php 8 SMF 2.0.19?
Post by: spiros on January 17, 2022, 11:45:47 AM
Lol, yes, I remember you mentioning Redis in another one of my questions. Sadly there is no implementation for that for SMF.
Title: Re: Memcached in php 8 SMF 2.0.19?
Post by: Arantor on January 17, 2022, 01:11:55 PM
Well, I did something pretty close to usable for 2.1, but there is a 2.0 mod - https://custom.simplemachines.org/index.php?mod=4119
Title: Re: Memcached in php 8 SMF 2.0.19?
Post by: spiros on January 17, 2022, 01:45:56 PM
Interesting, and here is post on installing redis on Cpanel servers: https://forums.cpanel.net/threads/recommended-way-to-install-redis-on-whm-centos-7.671773/post-2875697
Title: Re: Memcached in php 8 SMF 2.0.19?
Post by: danielrichter on January 24, 2022, 02:47:19 PM
@spiros Just give me a few more days and I'll release my redis cache addon.
Because of the help of @Arantor I will provide it to the SMF community, we use redis in a large cluster for all of our applications, so we were in need of redis for SMF too  :) .