If you prefer not to use the LiteSpeed Cache plugin included with WordPress installations on mybox, but still want to take advantage of Redis object caching, you can use the Redis Object Cache plugin available from the official WordPress plugin repository.
Redis object caching can significantly improve website performance by storing frequently accessed database queries in memory, reducing the number of database requests generated by WordPress.
If you don’t know what Redis is, the following list will help you get familiar with this technology:
– What is Redis?
– How do I activate the Redis server?
Before You Begin
Before configuring the plugin, make sure that:
- A Redis server is active for your hosting account.
- You have access to your WordPress administration panel.
- You have FTP access to your hosting account.
If Redis has not yet been enabled, activate it first from the mybox Panel.
Table of Contents
Step 1: Obtain the Redis Socket Path
Log in to the mybox Panel and navigate to:
Advanced → Redis Server Locate and copy the Redis socket path displayed there.
Example:
/home/mybox/YOUR-LOGIN/.redis/redis.sock You will need this value later when editing the WordPress configuration file.
Step 2: Install the Redis Object Cache Plugin
- Log in to your WordPress administration panel.
- Navigate to:
Plugins → Add New - In the search field, enter:
redis - Locate the plugin:
Redis Object Cache - Click:
Install Now - After installation, click:
Activate Step 3: Edit the wp-config.php File
Connect to your hosting account using FTP.
Navigate to your WordPress installation directory:
yourdomain.com/public_html Locate the file:
wp-config.php Open it for editing.
Step 4: Add Redis Configuration
Add the following lines above the line:
/* That's all, stop editing! Happy publishing. */ Replace the socket path with the value obtained from the mybox Panel.
/** Use Unix Socket */
define( 'WP_REDIS_SCHEME', 'unix' );
/** Redis Socket Path */
define( 'WP_REDIS_PATH', '/home/client.mybox.com/YOUR-LOGIN/.redis/redis.sock' ); Example:
define( 'WP_REDIS_SCHEME', 'unix' );
define( 'WP_REDIS_PATH', '/home/client.mybox.com/adrian/.redis/redis.sock' ); Save the file after making the changes.
Step 5: Verify the Connection
Return to your WordPress administration panel.
Navigate to:
Settings → Redis or:
Tools → Redis depending on the plugin version.
If everything has been configured correctly, you should see a message indicating that the plugin successfully connected to the Redis server.
Typical status messages include:
Connected or
Redis server reachable Step 6: Enable Object Cache
If the plugin displays an option such as:
Enable Object Cache click it to activate Redis caching for your WordPress installation.
Once enabled, WordPress will begin storing object cache data in Redis.
Troubleshooting
Plugin Cannot Connect to Redis
Verify that:
- Redis is enabled in the mybox Panel.
- The socket path is correct.
- The
wp-config.phpfile contains the correct configuration. - There are no extra spaces or syntax errors in the file.
Redis Status Shows Disconnected
Double-check the value of:
WP_REDIS_PATH and compare it with the socket path shown in the mybox Panel.
Website Displays Errors After Editing wp-config.php
Restore the original file or remove the Redis configuration lines and verify the syntax.
Even a missing semicolon can prevent WordPress from loading.
Benefits of Redis Object Cache
Using Redis can provide:
- Faster page generation
- Reduced MySQL load
- Improved performance on busy websites
- Better scalability
- Lower server resource usage
Redis is particularly beneficial for:
- WooCommerce stores
- Membership websites
- High-traffic blogs
- Dynamic WordPress applications
Summary
To configure Redis Object Cache in WordPress:
- Enable Redis in the mybox Panel.
- Copy the Redis socket path.
- Install and activate the Redis Object Cache plugin.
- Edit
wp-config.phpand add:
define( 'WP_REDIS_SCHEME', 'unix' );
define( 'WP_REDIS_PATH', '/path/to/redis.sock' ); - Save the file.
- Verify the connection in the plugin settings.
- Enable Object Cache.
Once configured successfully, WordPress will use Redis for object caching, helping improve website performance and reduce database load.