Support » Plugin: Redis Object Cache » wp-config parameter for unix socket connection?

  • Resolved sally

    (@sallyruchman)


    Hello,

    Connection via TCP Port is working, trying to get unix socket connection.

    Connected via TCP Port to Redis successful

    wp-config.php

    define( ‘WP_CACHE’, true );
    define( ‘WP_REDIS_HOST’, ‘127.0.0.1’ );
    define( ‘WP_REDIS_PASSWORD’, ‘xxxxxxxxxxx!’ );
    define( ‘WP_CACHE_KEY_SALT’, ‘domain.com’);
    define( ‘WP_REDIS_DATABASE’, 4 );

    Status: Connected
    Client: PhpRedis (v5.3.2)
    Drop-in: Valid
    Disabled: No
    Filesystem: Working
    Ping: 1
    Errors: []
    PhpRedis: 5.3.2
    Predis: Not loaded
    Credis: Not loaded
    PHP Version: 7.4.13
    Plugin Version: 2.0.15
    Redis Version: 6.0.9
    Multisite: No
    Global Prefix: “zo978787887v_”
    Blog Prefix: “zo978787887v_”
    WP_REDIS_HOST: “127.0.0.1”
    WP_REDIS_PORT: 6379
    WP_REDIS_DATABASE: 4
    WP_REDIS_PREFIX: “domain.com”
    WP_CACHE_KEY_SALT: “domain.com”
    WP_REDIS_PASSWORD: ••••••••

    Change Redis to Unix Socket

    # unixsocket /var/run/redis/redis.sock
    # unixsocketperm 770

    17960:M 14 Dec 2020 14:36:25.895 * Ready to accept connections
    17960:M 14 Dec 2020 14:36:25.895 * The server is now ready to accept connections at /var/run/redis/redis.sock

    Tried with the following wp-config settings:

    define(‘WP_CACHE’, true);
    define(‘WP_REDIS_SCHEME’, ‘unix’);
    define(‘WP_REDIS_PATH’, ‘/var/run/redis/redis.sock’);

    Are the 3 parameters for the unix socket connection sufficient, or are there some additional parameters missing?

    Thx
    Sally

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

    (@tillkruess)

    Hi Sally,

    WP_REDIS_PATH and WP_REDIS_SCHEME are enough.

    The WP_CACHE constant is unrelated to object caching. It’s only used for page caching.

    sally

    (@sallyruchman)

    Hi Till,

    Enable Object Cache with the 2 Parameters works but Status is not connected and under Diagnostics I get Connection Exception: Permission denied (RedisException).

    Plugin Author Till Krüss

    (@tillkruess)

    Please post your diagnostics.

    sally

    (@sallyruchman)

    Status: Not connected
    Client: PhpRedis (v5.3.2)
    Drop-in: Valid
    Disabled: No
    Filesystem: Working
    Ping:
    Connection Exception: Permission denied (RedisException)
    Errors: [
    “Permission denied”
    ]
    PhpRedis: 5.3.2
    Predis: Not loaded
    Credis: Not loaded
    PHP Version: 7.4.13
    Plugin Version: 2.0.15
    Redis Version: Unknown
    Multisite: No
    Global Prefix: “zo978787887v_”
    Blog Prefix: “zo978787887v_”
    WP_REDIS_SCHEME: “unix”
    WP_REDIS_PATH: “/var/run/redis/redis.sock”
    Global Groups: [
    “blog-details”,
    “blog-id-cache”,
    “blog-lookup”,
    “global-posts”,
    “networks”,
    “rss”,
    “sites”,
    “site-details”,
    “site-lookup”,
    “site-options”,
    “site-transient”,
    “users”,
    “useremail”,
    “userlogins”,
    “usermeta”,
    “user_meta”,
    “userslugs”,
    “redis-cache”
    ]
    Ignored Groups: [
    “counts”,
    “plugins”,
    “themes”,
    “blog-details”,
    “blog-id-cache”,
    “blog-lookup”,
    “global-posts”,
    “networks”,
    “rss”,
    “sites”,
    “site-details”,
    “site-lookup”,
    “site-options”,
    “site-transient”,
    “users”,
    “useremail”,
    “userlogins”,
    “usermeta”,
    “user_meta”,
    “userslugs”,
    “redis-cache”,
    “blog_meta”
    ]
    Unflushable Groups: []
    Drop-ins: [
    “Redis Object Cache Drop-In v2.0.15 by Till Krüss”
    ]

    Plugin Author Till Krüss

    (@tillkruess)

    Looks like PHP doesn’t have permission to access the socket path.

    sally

    (@sallyruchman)

    Thanks Till for the Information, will check this.

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