- Compatible XF 2.x versions
- 2.x
To setup XenForos build in Redis you do not need any addon.
This is all you need and works out of the box. You see, using Redis as a cache is very easy.
If you install the Redis php connector, the Redis-server itself will be installed automatically.
Here php8.3-redis matches my php version so I install this connector (as well as the Redis-server) with one line
Then start the Redis-server (in Ubuntu you do not need to do that, it does that automatically).
In Redhat you would use
In SUSE you use #zypper search redis | grep php
Thats all the difference for a minimal configuration between these two.
Related resources
Your Linux does not provide you with a Redis php connector ? But you have Redis-server installed and running? This addon
xenforo.com
is for you:
In Ubuntu 24.04
1. Install Redis
Bash:
Bash:
#apt install php8.3-redis
2. In src/config.php
PHP:
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['provider'] = 'Redis';
$config['cache']['config']['host'] = '127.0.0.1';
Longer version for other Linux distributions
1. Install RedisIf you install the Redis php connector, the Redis-server itself will be installed automatically.
Bash:
#apt search redis | grep php
(...)
php8.2-redis
php8.3-redis
Bash:
#apt install php8.3-redis
Bash:
#systemctl enable redis-server
#systemctl start redis-server
#systemctl status redis-server
Bash:
#dnf search redis | grep php
(...)
php8.2-redis
php8.3-redis
#dnf install php8.3-redis
PHP:
//$config['cache']['provider'] = 'Filesystem';
3. In src/config.php
PHP:
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['provider'] = 'Redis';
$config['cache']['config']['host'] = '127.0.0.1';
Why use Redis instead of the Filesystem?
Both work great with XenForo. The Filesystem works great as also a cache, but Redis is meant to be one.Disadvantages for the Filesystem
- you have to create a Filesystem directory (not needed for Redis)
- Filesystem directory has to be inaccessible for the Web
- Filesystem directory must have permissions for PHP to still write on it even when away from the public Web
- XenForo must check whether the written files in the Filesystem are too old or not (in Redis you can set a time frame in which the data is valid, then the data will be removed automatically)
- in the Filesystem the files can be actually be cached in RAM and therefore it can be very fast (if you have lots of RAM) but you are not sure about that
| Redis | Filesystem |
| host=127.0.0.1 | directory=/………….. |
Related resources
Your Linux does not provide you with a Redis php connector ? But you have Redis-server installed and running? This addon
Redis Cache By Xon
This add-on uses Credis with a custom cache provider for Redis. For best performance, install the php extension: phpredis You must have a Redis instance installed, this is likely not possible with shared hosting While XenForo 2 has a redis...
While XenForo 2 has a redis connector, it requires phpredis. This add-on does not.