Support » Plugin: WP Redis » Trying to access array offset on value of type null

  • Resolved strarsis

    (@strarsis)


    After installing, activating the WP Redis plugin and then enabling it via WP CLI,
    reds info CLI sub-command logs the following error:

    `
    In wp-redis.php line 64:
                                                           
      Trying to access array offset on value of type null  
    

    `
    The $redis_server variable is NULL, which shouldn’t happen.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Hi @strarsis,

    Sorry to hear you’re having trouble. Is this on a Pantheon-hosted site or elsewhere? Is WP Redis working for frontend requests?

    Thread Starter strarsis

    (@strarsis)

    @danielbachhuber: Hi Daniel, thanks for your response.
    This is _not_ on a Pantheon-hosted site. nginx, PHP-FPM and a local Redis server are used.

    This is the configuration (development with local Redis server):

    
    // Redis cache server (WP Redis plugin)
    $_SERVER['CACHE_HOST']        = 'redis';
    $_SERVER['CACHE_PORT']        = 6379;
    $_SERVER['CACHE_PASSWORD']    = '';
    $_SERVER['WP_CACHE_KEY_SALT'] = 'test-site';
    $_SERVER['CACHE_DB']          = 0;
    
    • This reply was modified 3 months ago by strarsis.
    Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Thanks @strarsis!

    Looking at this a little further, it appears the wp_redis_get_info() function doesn’t respect the value in $_SERVER, even though other parts of WP Redis do.

    Can you see if this pull request fixes the problem for you? If so, I’ll merge it and tag a 1.1.2 release.

    Thread Starter strarsis

    (@strarsis)

    @danielbachhuber: Thanks! Yes, with the PR applied it works.

    What still baffles me is that why it works on some other sites but not on this one.
    I am using the same configuration for these sites. Maybe an updated of this plugin in the meantime introduced this issue?

    Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Great! I’ve tagged a v1.1.2 release with the fix.

    Re: other sites, I’m not sure. Maybe they have some code somewhere setting $redis_server from $_SERVER? Not much has changed with WP Redis in the last couple of years…

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.