Koozali.org: home of the SME Server

Contribs.org Forums => Koozali SME Server 10.x Contribs => Topic started by: beast on April 01, 2024, 10:10:25 AM

Title: PHP memcache
Post by: beast on April 01, 2024, 10:10:25 AM
Hi

The page https://wiki.koozali.org/Memcached specify how to install php module memcache but the repo smeserver-extrarepositories-remi does not exist any more. How can I install memcache? Is it located in smeserver-extrarepositories-remi-unsafe? Like to update the page after I get it to work.

NB: May also be possible to use APCu and write a guide about that.

Thank you
/Benny
Title: Re: PHP memcache
Post by: Jean-Philippe Pialasse on April 01, 2024, 01:57:19 PM
which version of SME Server ?
Title: Re: PHP memcache
Post by: beast on April 01, 2024, 06:51:27 PM
which version of SME Server ?

10 with all updates
Title: Re: PHP memcache
Post by: Jean-Philippe Pialasse on April 01, 2024, 07:33:10 PM
remi-safe works for sme10. only thing is this how to works only for SME 9 contrary to what it states. 
Title: Re: PHP memcache
Post by: beast on April 01, 2024, 10:54:25 PM
remi-safe works for sme10. only thing is this how to works only for SME 9 contrary to what it states.

It complain about missing fastlz(x86-64). Where do I find that one?

Error: Package: php73-php-pecl-memcached-3.2.0-1.el7.remi.x86_64 (remi-safe)
           Requires: fastlz(x86-64)
Error: Package: php82-php-pecl-memcached-3.2.0-5.el7.remi.x86_64 (remi-safe)
           Requires: fastlz(x86-64)
Error: Package: php70-php-pecl-memcached-3.2.0-1.el7.remi.x86_64 (remi-safe)
           Requires: fastlz(x86-64)
Error: Package: php71-php-pecl-memcached-3.2.0-1.el7.remi.x86_64 (remi-safe)
           Requires: fastlz(x86-64)
Error: Package: php81-php-pecl-memcached-3.2.0-1.el7.remi.x86_64 (remi-safe)
           Requires: fastlz(x86-64)
Error: Package: php80-php-pecl-memcached-3.2.0-1.el7.remi.x86_64 (remi-safe)
           Requires: fastlz(x86-64)
Error: Package: php74-php-pecl-memcached-3.2.0-1.el7.remi.x86_64 (remi-safe)
           Requires: fastlz(x86-64)
Error: Package: php72-php-pecl-memcached-3.2.0-1.el7.remi.x86_64 (remi-safe)
           Requires: fastlz(x86-64)
Error: Package: php83-php-pecl-memcached-3.2.0-7.el7.remi.x86_64 (remi-safe)
           Requires: fastlz(x86-64)
Title: Re: PHP memcache
Post by: TerryF on April 02, 2024, 02:03:34 AM
# yum install memcached php*-pecl-memcached --enablerepo=epel

gets it done for me
Title: Re: PHP memcache
Post by: beast on April 02, 2024, 07:20:23 AM
# yum install memcached php*-pecl-memcached --enablerepo=epel

gets it done for me

Some command is missing as it return with:
Error getting repository data for epel, repository not found

This one?: https://wiki.koozali.org/Epel#For_SME_10.x
Title: Re: PHP memcache
Post by: TerryF on April 02, 2024, 07:50:50 AM
then you need to install the epel repo

https://mirror.canada.pialasse.com/releases/10/smeaddons/x86_64/RPMS/
Title: Re: PHP memcache
Post by: beast on April 02, 2024, 08:05:40 AM
then you need to install the epel repo

https://mirror.canada.pialasse.com/releases/10/smeaddons/x86_64/RPMS/

And how do I do that? Sorry but I only work with the server as a user now and then and I can find many different guides on the net.
The link provided is down.
Title: Re: PHP memcache
Post by: warren on April 02, 2024, 10:39:33 AM
And how do I do that? Sorry but I only work with the server as a user now and then and I can find many different guides on the net.
The link provided is down.

https://wiki.koozali.org/Extrarepositories (https://wiki.koozali.org/Extrarepositories)

Code: [Select]
yum  install smeserver-extrarepositories-epel
signal-event yum-modify
config set UnsavedChanges no
Title: Re: PHP memcache
Post by: beast on April 02, 2024, 11:13:26 AM
So the complete procedure is something like this (seams to install fine).

yum install smeserver-extrarepositories-remi-safe
yum install smeserver-extrarepositories-epel
signal-event yum-modify
yum install memcached php*-pecl-memcached
config set memcached service status enabled TCPPort 11211 access local
cd /etc/rc.d/rc7.d
ln -s S50memcached /etc/rc.d/init.d/memcached
config set UnsavedChanges no
service memcached start
Title: Re: PHP memcache
Post by: ReetP on April 02, 2024, 05:34:42 PM
Sorry but I only work with the server as a user now and then and I can find many different guides on the net.

If you are doing this you have become an administrator so you need to work on that.....

Koozali SME is very specific and though based on CentOS7, a lot of generic guides on the interwebs will not work properly. Be very careful.

Quote
So the complete procedure is something like this

You were told:

Quote
only thing is this how to works only for SME 9 contrary to what it states. 

The wiki page specifically states:

Quote
install memcached for SME9 only

So the answer is no, that won't work correctly as it was not designed for systemd.

You will need a config entry to tell Koozali about the service, and a systemd unit file override to start it at the right time.

https://wiki.koozali.org/Building_Your_Contrib#Systemd

https://wiki.koozali.org/SME10_serviceControl

You can probably use the config line

Code: [Select]
config set memcached service status enabled TCPPort 11211 access local
But you will need something like:

Code: [Select]
mkdir -p /usr/lib/systemd/system/memcached.d
nano 50koozali.conf

Paste in the following and save

Code: [Select]
[Install]
WantedBy=sme-server.target

You want a post-upgrade/reboot.

Check it is running with:

Code: [Select]
systemctl status memcached
On my test I did a console-save and then start to get it running.

Then you will have to test with the version of PHP etc etc.

It seems to run on mine but YMMV and I have no experience of it.

I've added that to the wiki but you can update as required.

It looks like there is a rpm for acpu but no idea how it works (beware pecl installs - always try  and use a rpm)

https://rhel.pkgs.org/7/epel-x86_64/php-pecl-apcu-4.0.11-1.el7.x86_64.rpm.html

IIRC you have a rocket chat account so please talk to us there if you want guidance and help doing this.
Title: Re: PHP memcache
Post by: beast on April 07, 2024, 07:45:14 AM
I can confirm that it works fine for me :-)