• Resolved rpnews

    (@rpnews)


    Hi there,

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    The error PHP Fatal error: Uncaught Error: Class 'RedisCluster' means that the PhpRedis extension is not loaded in your PHP-FPM process.

    Try using predis as the client instead.

    Thread Starter rpnews

    (@rpnews)

    OK, never mind, it appears to be working now.
    It seems restarting apache after editing php.ini wasn’t enough, I had to restart php-fpm! I thought the former would also do the latter.

    Carry on. Thx for the plugin <3

    Just missed your reply above, Thx Till.

    • This reply was modified 8 months, 3 weeks ago by rpnews.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘AWS Elasticache – phpredis – ‘RedisCluster’ not found’ is closed to new replies.