0

i'm quite new in openlitespeed but i've successfully installed OLS on Ubuntu 20.

I want to enable Redis or Memcached, which is correctly configured.

I've installed php extension (redis.ini) for Redis and i can find extension in folder:

/etc/php/7.4/mods-available

But OLS has it's own php 7.4 version or at least config files in folder:

/usr/local/lsws/lsphp74/etc/php/7.4/mods-available

and here is no redis.ini file.

How should i enable php extension for OLS?

Ilkar
  • 2,113
  • 9
  • 45
  • 71

1 Answers1

0

You need to install a LiteSpeed specific Redis package to make this work which is supposed to be in their Ubuntu repo: lsphp74-redis. However, it's not there even though it says in the documentation it should be there. The solution is to install the LiteSpeed pear extension from the LiteSpeed repos and then use pecl to install Redis. They explain it here: https://docs.litespeedtech.com/extapp/php/extensions/

The commands I used specifically:

apt install lsphp74-pear

followed by

/usr/local/lsws/lsphp74/bin/pecl install resdis

Don't forget to make a /usr/local/lsws/lsphp74/etc/php/7.4/mods-available/redis.ini with something like this:

; configuration for php redis
; priority=20
extension=redis.so

They give instructions for Redhat and Ubuntu/Debian in the link.

The good thing about using pecl is that you can basically install any extension you want since they provide the LiteSpeed pecl extension. I personally prefer straight binary packages for maintenance purposes but this works.

Dom
  • 2,240
  • 16
  • 22