# How to enable Redis cache via Unix socket on HumHub

> Configure HumHub to use Redis cache via a Unix socket by editing two configuration files in your HumHub installation.

Source: https://www.kualo.com/knowledgebase/other-apps/how-to-enable-redis-cache-via-unix-socket-on-humhub
Updated: 2026-06-04

---

Before making any changes to HumHub, you will need to enable your Redis instance in cPanel. Follow the instructions in [Enable Redis Unix Socket](/knowledgebase/cpanel-how-tos/how-to-set-up-redis-in-cpanel) to do that first.

## Edit common.php

Open `protected/config/common.php` and update the `cache` component to use the Redis Unix socket:

```php
return [
    'components' => [
        'cache' => [
            'class' => yii\redis\Cache::class,
            'defaultDuration' => 86400,
            'redis' => [
                'unixSocket' => '/home/USERNAME/.kxcache/redis.sock',
                'database' => 0,
            ],
        ],
    ],
];
```

Replace `USERNAME` with your cPanel username.

## Check dynamic.php

Open `protected/config/dynamic.php` and confirm that:

- There is no `useApcu` key defined for caching.
- The `cache` entry under `components` uses the Redis Yii caching class, like this:

```php
'cache' => [
    'class' => 'yii\\caching\\Redis',
    'keyPrefix' => 'humhub'
],
```

If `useApcu` is present, remove it or set it to `false` so that HumHub uses Redis rather than APCu for caching.

---

_Source: Kualo Knowledgebase — https://www.kualo.com/knowledgebase/other-apps/how-to-enable-redis-cache-via-unix-socket-on-humhub · © Kualo Ltd._
