1

I have about 50 sites in my server. I have installed redis to be used for cache and trying to cinfigure redis object cache plugin. I have done all the configurations I have read. Without the WP_CACHE_KEY_SALT and WP_REDIS_DATABASE, all the domain links redirect to one website that has been cached. Here is an example of my wp-config.php

define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', '6379');
define('WP_REDIS_PREFIX', 'uniqueprefix_');
//define('WP_REDIS_DATABASE', 1);
define( 'WP_CACHE_KEY_SALT', 'domainname.tld:' );

From the code above, I have tried using a different database, but I get an error. Tried using WP_CACHE_KEY_SALT still getting an error. All solutions from this link here have not worked.

Please help me figure out what I could be doing wrong. I am using hestia cp (nginx + apache2)

3
  • How did you install Redis? Might be worth checking that it's running correctly, how you check will depend on the operating system of your host and how to installed Redis.
    – Hugo
    Commented Nov 4, 2023 at 16:02
  • sudo apt update sudo apt install redis-server sudo nano /etc/redis/redis.conf //here I bound my local ip address sudo apt install php-redis sudo service apache2 restart sudo service nginx restart Commented Nov 6, 2023 at 9:33
  • You say you bound it to your local IP address, was that 127.0.0.1? If not then you won't be able to connect through loopback, change your binding to 127.0.0.1 and then restart redis: sudo service redis* restart
    – Hugo
    Commented Nov 6, 2023 at 22:41

1 Answer 1

0

I had the same issue lately and you need to configure WP_REDIS_PREFIX in wp-config.php

define( 'WP_REDIS_PREFIX', 'your_unique_key_for_each_wp_instance_' );

for each WP site. This solved my case.

1
  • I have done that. You can see it in my question under the things I have tried to configure. define('WP_REDIS_PREFIX', 'uniqueprefix_'); Commented Oct 22, 2023 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.