I can connect to an AWS Redis cluster and am using the phpredis client as I’ve noted from docs https://github.com/rhubarbgroup/redis-cache?tab=readme-ov-file#scaling and another forum post: https://www.ads-software.com/support/topic/group-flush-not-working-on-aws-elasticache-serverless/
However, when I enable object caching I get an error:
[04-Mar-2024 10:14:32 UTC] PHP Fatal error: Uncaught Error: Class 'RedisCluster' not found in /bitnami/wordpress/wp-content/object-cache.php:693
Stack trace:
#0 /bitnami/wordpress/wp-content/object-cache.php(536): WP_Object_Cache->connect_using_phpredis()
#1 /bitnami/wordpress/wp-content/object-cache.php(256): WP_Object_Cache->__construct()
#2 /opt/bitnami/wordpress/wp-includes/load.php(856): wp_cache_init()
#3 /opt/bitnami/wordpress/wp-settings.php(131): wp_start_object_cache()
#4 /bitnami/wordpress/wp-config.php(198): require_once('/opt/bitnami/wo...')
#5 /opt/bitnami/wordpress/wp-load.php(50): require_once('/bitnami/wordpr...')
#6 /opt/bitnami/wordpress/wp-blog-header.php(13): require_once('/opt/bitnami/wo...')
#7 /opt/bitnami/wordpress/index.php(17): require('/opt/bitnami/wo...')
#8 {main}
thrown in /bitnami/wordpress/wp-content/object-cache.php on line 693
I’ve consulted the phpredis docs https://github.com/phpredis/phpredis/blob/develop/INSTALL.md and installed phpredis via:
pecl install redis
enabling said extension within php.ini
Status: Not enabled
Client: phpredis
Drop-in: Not installed
Disabled: No
PhpRedis: Not loaded
Relay: Not loaded
Predis: 2.1.2
Credis: Not loaded
PHP Version: 7.4.27
Plugin Version: 2.5.1
Redis Version: Unknown
Multisite: No
Metrics: Disabled
Metrics recorded: 0
Filesystem: Writable
WP_REDIS_CLIENT: "phpredis"
WP_REDIS_CLUSTER: [
"tcp://xxx-0001-001.yyy.zzz.euw1.cache.amazonaws.com:6379?alias=node-01",
"tcp://xxx-0001-002.yyy.zzz.euw1.cache.amazonaws.com:6379?alias=node-02"
]
WP_REDIS_PLUGIN_PATH: "/bitnami/wordpress/wp-content/plugins/redis-cache"
Drop-ins: []
define( 'WP_REDIS_CLIENT', 'phpredis' );
define( 'WP_REDIS_CLUSTER', [
'tcp://xxx-0001-001.yyy.zzz.euw1.cache.amazonaws.com:6379?alias=node-01',
'tcp://xxx-0001-002.yyy.zzz.euw1.cache.amazonaws.com:6379?alias=node-02',
] );
Any pointers as to what I’m missing? Thanks in advance.
]]>first of all thank you for providing this awesome plugin.
Until yesterday, it worked perfectly. We did not change any configuration, did not update plugins or anything else on the page. Today we’ve got this error and a broken WordPress instance:
NOTICE: PHP message: RedisException: MOVED 3889 xxx-0001-002.xxx.xxx.memorydb.sa-east-1.amazonaws.com:6379 in /usr/src/wordpress/wp-content/object-cache.php:1922
We configured WP_REDIS_HOST
with clustercfg.xxx.xxx.memorydb.sa-east-1.amazonaws.com
. As far as I’m understanding predis as well as phpredis, both are able to resolve clusters without providing a dedicated cluster configuration.
Obviously xxx-0001-002.
is resolved via clustercfg
.
Now we’re not able to get the page up and running with object cache enabled.
Redis is running as AWS MemoryDB with multiple nodes and shards. As said – worked until today.
I’m not sure how to continue here. Any ideas?
Thank you in advance and best regards,
Sascha
I’ve installed this plugin and made all the necessary configurations in the wp-config file (Host, Port, Password, etc). Now I’m getting this error (PhpRedis extension is not installed) and I need some help to resolve this.
I’m using an Azure App Service based on Linux.
Best regards,
Mário Teixeira
As the title says, do I have to install phpredis in my free version of the plugin?
Redis is working fine, I see all the keys and analytics, but I wonder if performance will be improved in any way if go thru the process of installing it.
Thanks for your support.
]]>Environment:
Docker containers:
I have confirmed that Redis is working and is connected through the Redis Object Cache plugin. I had to modify the wp-config.php to include the Redis configuration information. I also added in the db-config.php file within the W3 cache plugin directory with the following settings:
//
// redis config cache
//
define( 'W3TC_CONFIG_CACHE_ENGINE', 'redis');
define( 'W3TC_CONFIG_CACHE_REDIS_SERVERS', 'site1-cache::6379' );
// optional redis settings
define( 'W3TC_CONFIG_CACHE_REDIS_PERSISTENT', true );
define( 'W3TC_CONFIG_CACHE_REDIS_DBID', 0 );
define( 'W3TC_CONFIG_CACHE_REDIS_PASSWORD', '' );
wp-config.php (redis section)
/** Define Redis Caching **/
define('WP_REDIS_HOST', 'site1-cache');
//define('WP_REDIS_CLIENT', 'predis'); // appears that even though PHPredis is specified below, the plugin still utilizes predis
define('WP_REDIS_CLIENT', 'phpredis');
//define('WP_CACHE', 'true'); // this is already defined at the top of the file.
define('WP_CACHE_KEY_SALT', 'site1');
define('WP_REDIS_DISABLE_BANNERS', 'true');
define('WP_REDIS_DATABASE', '0');
define('WP_REDIS_TIMEOUT', '5'); // timeout in seconds
define('WP_REDIS_READ_TIMEOUT', '5'); // Read timeout in seconds
define('WP_REDIS_RETRY_INTERVAL', '100'); // Retry interval in milliseconds
Is there something that I’m doing wrong in order for W3 to actually recognize Redis as an option for caching?
]]>Do you think I could do that with yours? Thank you!
]]>sudo bash -c "echo extension=redis.so > /etc/php7.X-sp/conf.d/redis.ini
command returned me a no foder or file warning. I am using a centos php7.2. Does some one here know what should I change on that line to get PHPRedis extencion alright?
Thank you!
]]>The changelog:
This release contains important improvements and breaking changes.
The most interesting are: drop PHP5 support, RedisCluster slots caching,
JSON and msgpack serializers, soft deprecation of non-Redis commands.phpredis 5.0.0
* Remove HAVE_SPL [55c5586c] (@petk)
* Update Fedora installation instructions [90aa067c] (@remicollet)phpredis 5.0.0RC2
* Allow compilation without JSON serialization enabled and fixes for deprecated
helper methods. [235a27] (Pavlo Yatsukhnenko)
* Fix php msgpack >= 2.0.3 version requirement. [6973478..a537df8] (Michael Grunder)phpredis 5.0.0RC1
* Enable connection pooling by default [8206b147] (Pavlo Yatsukhnenko)
* Soft deprecate methods that aren’t actually Redis commands [a81b4f2d, 95c8aab9] (Pavlo Yatsukhnenko, Michael Grunder)
* Enable pooling for cluster slave nodes [17600dd1] (Michael Grunder)
* xInfo response format [4852a510, ac9dca0a] (Pavlo Yatsukhnenko)
* Make the XREADGROUP optional COUNT and BLOCK arguments nullable [0c17bd27] (Michael Grunder)
* Allow PING to take an optional argument [6e494170] (Michael Grunder)
* Allow ZRANGE to be called either withtrue
or['withscores' => true]
[19f3efcf] (Michael Grunder)
* Allow to specify server address as schema://host [418428fa] (Pavlo Yatsukhnenko)
* Allow persistent_id to be passed as NULL with strict_types enabled [60223762] (Michael Grunder)
* Add server address to exception message [e8fb49be, 34d6403d] (Pavlo Yatsukhnenko)
* Adds OPT_REPLY_LITERAL for rawCommand and EVAL [5cb30fb2] (Michael Grunder)
* JSON serializer [98bd2886, 96c57139] (Pavlo Yatsukhnenko, Michael Grunder)
* Add support for STREAM to the type command [d7450b2f, 068ce978, 8a45d18c] (Michael Grunder, Pavlo Yatsukhnenko)
* Fix TypeError when using built-in constants insetOption
[4c7643ee] (@JoyceBabu)
* Handle references in MGET [60d8b679] (Michael Grunder)
* msgpack serializer [d5b8f833, 545250f3, 52bae8ab] (@bgort, Pavlo Yatsukhnenko, Michael Grunder)
* Add Cluster slots caching [9f0d7bc0, ea081e05] (Michael Grunder)
* Drop PHP5 support [f9928642, 46a50c12, 4601887d, 6ebb36ce, fdbe9d29] (Michael Grunder)
* Documentation improvements (@alexander-schranz, @cookieguru, Pavlo Yatsukhnenko, Michael Grunder)
Thanks!
]]>I have a problem with the speed of the backend of WordPress.
With W3 Total Cache enabled the backend is very slow.
I look to know if it is possible to make the backend faster.
I did it with Redis and the Redis Object Cache plugin.
But now i have Redis working with W3 Total Cache, see my tutorial.
But another but, it is now slower with W3 Total Cache, then with Redis Object Cache plugin.
It looks like that W3 Total Cache caching almost nothing, when you are logged in.
Is it possible to use some of the W3 Total Cache feautures, like Redis, when you are logged in?
Or did i see it the wrong way and is there already caching at the backend with W3 Total Cache…