Enabling Redis object caching on your WordPress site can significantly boost performance by reducing database queries and speeding up backend response times. This guide walks you through setting up Redis caching using Control Web Panel (CWP) and ALT PHP-FPM 8.3, with Redis installed locally on your server.
Whether you run a single high-traffic website or host multiple WordPress sites, Redis is more scalable and powerful than APCu β and ideal for WooCommerce or dynamic content caching.
β What Youβll Achieve
- Redis server installed and running
- PHP 8.3 configured with Redis extension
- WordPress integrated with Redis cache
- Verified object cache running efficiently
π§ Step 1: Install Redis Server on Your CWP Server
SSH into your server and run:
yum install redis -y
systemctl enable redis
systemctl start redis
Check status:
systemctl status redis
β
You should see: active (running)
β Step 2: Compile and Install Redis Extension for PHP-FPM 8.3
Since ALT PHP builds donβt include PECL by default, youβll compile it manually:
Download and build:
cd /usr/local/src
wget https://pecl.php.net/get/redis
tar -xzf redis
cd redis-*
/opt/alt/php-fpm83/usr/bin/phpize
./configure --with-php-config=/opt/alt/php-fpm83/usr/bin/php-config
make
make install
β Output should confirm:
Installing shared extensions: /opt/alt/php-fpm83/usr/lib/php/extensions/...
β Step 3: Enable Redis Extension in PHP 8.3
Edit your PHP config:
nano /opt/alt/php-fpm83/usr/php/php.ini
Add this line:
extension=redis.so
Then restart PHP-FPM:
systemctl restart php-fpm83
π§ͺ Step 4: Verify Redis Extension is Active
Run:
/opt/alt/php-fpm83/usr/bin/php -m | grep redis
β
You should see: redis
π Step 5: Enable Redis Caching in WordPress
Install Plugin:
- Go to WordPress Dashboard β Plugins β Add New
- Search for:
Redis Object Cache
- Install and activate it
- Go to Settings β Redis
- Click Enable Object Cache
The plugin should auto-connect to your local Redis server.
Optional: Add Redis Configuration in wp-config.php
If Redis doesnβt connect automatically:
define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
define('WP_REDIS_DISABLED', false);
β Step 6: Confirm Itβs Working
- Go to Tools β Site Health
- β The βUse persistent object cacheβ warning should be gone
- Plugin dashboard shows:
Status: Connected
andObject Cache: Enabled
π Why Redis Over APCu?
Feature | Redis | APCu |
---|---|---|
Shared across sites | β | β (per-process) |
Network accessible | β | β |
Scalable (WooCommerce) | β | β |
Persistent | β | β (RAM-only) |
Redis is ideal for multiple WordPress sites, high-traffic projects, and stores using WooCommerce or LMS plugins.
π§ Pro Tip: Pre-Configure Redis for All WordPress Installs
To automate Redis use:
- Pre-install the Redis Object Cache plugin
- Add this to your
wp-config.php
template:
define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
define('WP_REDIS_DISABLED', false);
Now all future WordPress installs will auto-connect to Redis.
π¬ Need Expert Setup?
Prefer a hands-free setup?
π¨ Contact Servers9 Support β they’ll install Redis, configure PHP, and set up WordPress caching professionally for you.