# Use Redis object caching without LiteSpeed Cache
Source: https://docs.webgee.com/en/hosting/wordpress/how-to-configure-wordpress-to-use-redis





Enable Redis object caching on a WordPress site that does **not** use LiteSpeed
Cache. Applies to shared, reseller and Premium hosting.

If you do use LiteSpeed Cache, it has object caching built in and you do not
need a second plugin — see
[Enable Redis object caching](/en/performance/redis-object-caching-lscache)
instead.

<Callout type="info">
  LiteSpeed Cache is the recommended caching plugin on WebGee. It talks directly
  to the LiteSpeed web servers your sites run on, which no other plugin can do.
  This article is for sites already committed to a different caching plugin.
</Callout>

## 1. Enable Redis in cPanel [#1-enable-redis-in-cpanel]

1. In cPanel, open **Redis**.
2. Select **Enable Redis**.
3. Copy the **socket path** shown. You need it in step 3.

   <img alt="The Redis Manager page in cPanel showing the socket path" src="__img0" />

You can return to this page at any time to see it again.

## 2. Enable the PHP extension [#2-enable-the-php-extension]

1. In cPanel, open **Select PHP Version**.
2. Select **Extensions**.
3. Tick **redis**.

## 3. Install and configure the plugin [#3-install-and-configure-the-plugin]

1. In WordPress, go to **Plugins → Add New**.

2. Search for **Redis Object Cache** — the one by Till Krüss.

3. Select **Install Now**, then **Activate**.

4. Edit `wp-config.php` and add the socket path from step 1, above the line that
   reads `/* That's all, stop editing! */`:

   ```php
   define( 'WP_REDIS_SCHEME', 'unix' );
   define( 'WP_REDIS_PATH', '/home/cpaneluser/.redis/redis.sock' );
   ```

5. In WordPress, go to **Settings → Redis** and select **Enable Object Cache**.

## Check it worked [#check-it-worked]

On **Settings → Redis**, the status should read **Connected**.

If it does not:

* **`Connection refused`** — Redis is not enabled. Re-check step 1.
* **`Class 'Redis' not found`** — the PHP extension is off. Re-check step 2.
* **The socket path is wrong.** Copy it again from **cPanel → Redis**; it is
  regenerated whenever Redis is disabled and re-enabled.

## If you run several WordPress sites on one account [#if-you-run-several-wordpress-sites-on-one-account]

Redis Object Cache uses the WordPress **database table prefix** as its cache key
prefix. Two sites sharing a prefix will share cache entries, and each will start
serving fragments of the other — usually seen as the wrong site name, wrong menu
or wrong post content appearing at random.

This only happens when all of the following are true:

* The sites were installed manually rather than through Softaculous, which
  assigns a unique prefix automatically.
* Two or more of them use the same prefix, typically the default `wp_`.
* More than one has Redis Object Cache active.

To fix it, give each site a distinct table prefix, or set a distinct cache key
prefix per site in `wp-config.php`:

```php
define( 'WP_REDIS_PREFIX', 'site1_' );
```

Deactivating the plugin resolves the symptoms immediately while you sort the
prefixes out.

## Related [#related]

* [Enable Redis object caching with LiteSpeed Cache](/en/performance/redis-object-caching-lscache)
* [Redis memory limits](/en/performance/redis-limits-php-fatal-error-uncaught-redisexception-oom-command-not-allowed-whe)
* [Which object cache should I use?](/en/performance/memcached-vs-redis-which-is-best-for-my-website)
