Title: Status: Not connected
Last modified: February 26, 2017

---

# Status: Not connected

 *  Resolved Anonymous User 7326277
 * (@anonymized-7326277)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/)
 * I have this weird issue after changing way plugin connects to the Redis. I’ve
   placed following two entries in wp-config.php file:
 *     ```
       define( 'WP_REDIS_SCHEME', 'unix' );
       define( 'WP_REDIS_PATH', '/var/run/redis/redis.sock' );
       ```
   
 * When checking status via wp-cli utility I’m getting following result:
 *     ```
       $ wp redis status
       Status: Connected
       Client: PECL Extension (v3.0.0)
       ```
   
 * But in website interface it says:
 * `Not Connected`
 * Any ideas or suggestions what to check?

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/status-not-connected/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/status-not-connected/page/2/?output_format=md)

 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850028)
 * Weird, could you please post your “Diagnostics” section?
 *  Thread Starter Anonymous User 7326277
 * (@anonymized-7326277)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850303)
 * Sorry, here it is:
 *     ```
       PHP Version: 7.0.15
       Multisite: No
       Redis: 3.0.0
       Predis: 1.1.1
       Status: Not Connected
       Client: PECL Extension (v3.0.0)
       WP_REDIS_SCHEME: "unix"
       WP_REDIS_PATH: "\/var\/run\/redis\/redis.sock"
       WP_CACHE_KEY_SALT: ""
       Drop-in: Valid
       Global Prefix: "TABLEPREFIX_"
       Blog Prefix: "TABLEPREFIX_"
       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"]
       Ignored Groups: ["counts","plugins","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","themes"]
       ```
   
 * I’ve replaced table prefix with “TABLEPREFIX” but that info should really not
   be relevant anyways.
 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850407)
 * Can you try connecting using `tcp` and see if ui and cli show “Connected”?
 *  Thread Starter Anonymous User 7326277
 * (@anonymized-7326277)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850413)
 * `tcp` with unix socket combination? That is my report in fact, when using tcp
   and connecting via 127.0.0.1 it works flawlessly. If I bind redis to some other
   local IP and point redis plugin to it or use unix socket it results in situation
   mentioned in first post.
 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850451)
 * I’d suggest just using `tcp`, or trying `unix` with Predis instead of PhpRedis.
 *  Thread Starter Anonymous User 7326277
 * (@anonymized-7326277)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850460)
 * Any idea then why, when using tcp with any other IP other than 127.0.0.1 I get
   completely same situatioN?
 *  [blindpet](https://wordpress.org/support/users/blindpet/)
 * (@blindpet)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850474)
 * To answer your other question about IPs I would assume it is a firewall issue,
   you can list your iptable rules with `iptables -L`
 *  Thread Starter Anonymous User 7326277
 * (@anonymized-7326277)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850485)
 * Redis is listening on a socket with permissions 770, ownership is redis:redis
   and user under which site is running is in redis group so it should be able to
   access it normally.
 * Tried switching to predis but seems like it is not working:
 * Client: PECL Extension (v3.0.0)
    WP_REDIS_CLIENT: “predis”
 * Regarding IPTables, I’m not using Linux in this case so IPTables is not used,
   but to answer the question, firewall is not blocking access.
 *  [blindpet](https://wordpress.org/support/users/blindpet/)
 * (@blindpet)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850490)
 * That is very likely your problem @ivantomica I suggest you check out that link
   I posted before. Unless your php handler (php-fpm or apache) is running as the
   redis user or group then access will be denied.
 * You can do a quick test with chmod 777 on the unix socket and re-test.
 *  Thread Starter Anonymous User 7326277
 * (@anonymized-7326277)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850535)
 * Tried that [@blindpet](https://wordpress.org/support/users/blindpet/) , same 
   issue.
 *  [blindpet](https://wordpress.org/support/users/blindpet/)
 * (@blindpet)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8850538)
 * Please share the php handler you are using and the user name it runs under (netstat-
   lntp). Also please list ls -lh for the folder which contains your unix socket.
 *  Thread Starter Anonymous User 7326277
 * (@anonymized-7326277)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8851785)
 * Permissions on the folder (bare in mind that I’ve tried changing permissions 
   of the folder to 777 as well as socket perm to 777 just for testing purposes):
 *     ```
       root@www:~ # ls -ld /var/
       drwxr-xr-x  25 root  wheel  25 Feb 26 13:39 /var/
       root@www:~ # ls -ld /var/run
       drwxr-xr-x  5 root  wheel  18 Feb 27 03:45 /var/run
       root@www:~ # ls -ld /var/run/redis/
       drwxr-xr-x  2 redis  redis  4 Feb 26 21:21 /var/run/redis/
       root@www:~ # ls -ld /var/run/redis/redis.sock
       srwxrwx---  1 redis  redis  0 Feb 26 21:21 /var/run/redis/redis.sock
       ```
   
 * Relevant part from php-fpm pool configuration:
 *     ```
       user = USER
       group = USER
       listen.owner = nobody
       listen.group = nobody
       ```
   
 * Also note that I’m using redis as session handler without any issues for the 
   same PHP pool:
 *     ```
       php_value[session.save_handler] = redis
       php_value[session.save_path]    = "unix:///var/run/redis/redis.sock"
       ```
   
 * Sockstat output:
 *     ```
       root@www:~ # sockstat -l |grep redis
       redis    redis-serv 4473  4  tcp4   127.0.0.131:6379      *:*
       redis    redis-serv 4473  5  stream /var/run/redis/redis.sock
       ```
   
 * PHP-FPM pool sockstat:
 *     ```
       root@www:~ # sockstat -l | grep php
       USER   php-fpm    5773  0  stream /var/run/www.DOMAIN
       USER   php-fpm    3412  0  stream /var/run/www.DOMAIN
       ```
   
 * User:
 *     ```
       root@www:~ # id USER
       uid=1001(USER) gid=1001(USER) groups=1001(USER),535(redis)
       ```
   
 *  Thread Starter Anonymous User 7326277
 * (@anonymized-7326277)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8851802)
 * Also tried changing group ownership of redis folder that contains socket to the
   primary group of user. No help.
 *  [blindpet](https://wordpress.org/support/users/blindpet/)
 * (@blindpet)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/#post-8851837)
 * Can you share your redis.conf file too please @ivantomica
 *  Thread Starter Anonymous User 7326277
 * (@anonymized-7326277)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/status-not-connected/page/2/#post-8851847)
 * Here it is:
 *     ```
       root@www:~ # grep -v ^# /usr/local/etc/redis.conf | sed '/^$/d'
       bind 127.0.0.131
       protected-mode yes
       port 6379
       tcp-backlog 511
       unixsocket /var/run/redis/redis.sock
       unixsocketperm 770
       timeout 0
       tcp-keepalive 300
       daemonize yes
       supervised no
       pidfile /var/run/redis/redis.pid
       loglevel notice
       logfile /var/log/redis/redis.log
       databases 16
       save 900 1
       save 300 10
       save 60 10000
       stop-writes-on-bgsave-error yes
       rdbcompression yes
       rdbchecksum yes
       dbfilename dump.rdb
       dir /var/db/redis/
       slave-serve-stale-data yes
       slave-read-only yes
       repl-diskless-sync no
       repl-diskless-sync-delay 5
       repl-disable-tcp-nodelay no
       slave-priority 100
       appendonly no
       appendfilename "appendonly.aof"
       appendfsync everysec
       no-appendfsync-on-rewrite no
       auto-aof-rewrite-percentage 100
       auto-aof-rewrite-min-size 64mb
       aof-load-truncated yes
       lua-time-limit 5000
       slowlog-log-slower-than 10000
       slowlog-max-len 128
       latency-monitor-threshold 0
       notify-keyspace-events ""
       hash-max-ziplist-entries 512
       hash-max-ziplist-value 64
       list-max-ziplist-size -2
       list-compress-depth 0
       set-max-intset-entries 512
       zset-max-ziplist-entries 128
       zset-max-ziplist-value 64
       hll-sparse-max-bytes 3000
       activerehashing yes
       client-output-buffer-limit normal 0 0 0
       client-output-buffer-limit slave 256mb 64mb 60
       client-output-buffer-limit pubsub 32mb 8mb 60
       hz 10
       aof-rewrite-incremental-fsync yes
       ```
   

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/status-not-connected/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/status-not-connected/page/2/?output_format=md)

The topic ‘Status: Not connected’ is closed to new replies.

 * ![](https://ps.w.org/redis-cache/assets/icon-256x256.gif?rev=2568513)
 * [Redis Object Cache](https://wordpress.org/plugins/redis-cache/)
 * [Support Threads](https://wordpress.org/support/plugin/redis-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/redis-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redis-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redis-cache/reviews/)

 * 20 replies
 * 0 participants
 * Last reply from: [computersalat](https://wordpress.org/support/users/computersalat/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/status-not-connected/page/2/#post-9292999)
 * Status: resolved