• Resolved k199

    (@k199)


    Hi, I came across critical error in wordpress while trying to add a aws elastic cache using redis plugin.

    This is the error in wordpress debug.log

    [03-May-2023 22:29:13 UTC] PHP Fatal error:  Uncaught RedisException: Connection refused in /var/www/html/wordpress/wp-content/object-cache.php:726
    1. I tested accessing my redis access point. It was working.
    2. Php-redis installed and tested.
    3. double check I added following in wp-config file:
    define('WP_CACHE_KEY_SALT', 'your-unique-salt-here');
    define('WP_CACHE', true);
    define('WP_REDIS_HOST', '<aws-redis-access-point>');
    define('WP_REDIS_PORT', '6379');

    any advice on this?

    PS: I tried recovering the site by deactivate plug-in with following steps:

    1. renamed wp-contect/plug-in folder to plug-in.deactivate
    2. change database wp_options table active_plugins row tp option_value field to: a:0:{}

    But the site is showing critical error. Any thing else I should do about it?

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

    (@tillkruess)

    That’s a super common problem on EC2. Connection refused means EC2 cannot connect to Redis (Elasticache). Their support team can assist you with the VPN.

    Thread Starter k199

    (@k199)

    But I test EC2 to Elasticache connection with this test file in /var/www/html/test.php

    <?php
    $redis = new Redis();
    $redis->connect('<aws_elastic_access_point>', 6379);
    $redis->set('test_key', 'test_value');
    echo $redis->get('test_key');
    ?>

    When i type in ec2ip/test.php in browser, its showing ‘test_value’, I assume this should be meaning the connection between ec2 and redis is working?

    Plugin Author Till Krüss

    (@tillkruess)

    Thread Starter k199

    (@k199)

    Thanks for prompt reply.

    I went through install instruction again. It turns out its because of my wp_redis constants in wp-config.php is below abs.path wp-setting require.

    Thank you

    Plugin Author Till Krüss

    (@tillkruess)

    Glad it’s resolved 👍

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘using AWS elastic Redis cache for wordpress’ is closed to new replies.