Title: Docker
Last modified: March 28, 2021

---

# Docker

 *  Resolved [Kristiyan Katsarov](https://wordpress.org/support/users/katsar0v/)
 * (@katsar0v)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/docker/)
 * Hello guys, I have WordPress and Redis dockerized, but it seems that the client
   for some reason closes the connection.
 *     ```
       Status: Not connected
       Client: PhpRedis (v5.1.1)
       Drop-in: Valid
       Disabled: No
       Ping: 
       Errors: [
           "Connection refused"
       ]
       PhpRedis: 5.1.1
       Predis: Not loaded
       Credis: Not loaded
       PHP Version: 7.4.2
       Plugin Version: 2.0.17
       Redis Version: Unknown
       Multisite: No
       Filesystem: Working
       Global Prefix: "cms_wp_"
       Blog Prefix: "cms_wp_"
       WP_REDIS_HOST: "redis"
       WP_REDIS_PORT: 6379
       WP_REDIS_PASSWORD: ••••••••
       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: [
           "advanced-cache.php v by ",
           "Redis Object Cache Drop-In v2.0.17 by Till Krüss"
       ]
       ```
   
 * Here are the details of my container:
 *     ```
       "NetworkSettings": {
                   "Bridge": "",
                   "SandboxID": "f7e726af4087f62e585ec6aa5a5f20708ac27d209b5a770f64a608a02457c422",
                   "HairpinMode": false,
                   "LinkLocalIPv6Address": "",
                   "LinkLocalIPv6PrefixLen": 0,
                   "Ports": {
                       "6379/tcp": null
                   },
                   "SandboxKey": "/var/run/docker/netns/f7e726af4087",
                   "SecondaryIPAddresses": null,
                   "SecondaryIPv6Addresses": null,
                   "EndpointID": "",
                   "Gateway": "",
                   "GlobalIPv6Address": "",
                   "GlobalIPv6PrefixLen": 0,
                   "IPAddress": "",
                   "IPPrefixLen": 0,
                   "IPv6Gateway": "",
                   "MacAddress": "",
                   "Networks": {
                       "local-network": {
                           "IPAMConfig": null,
                           "Links": null,
                           "Aliases": [
                               "redis",
                               "9baf69f42063"
                           ],
                           "NetworkID": "1a584de10c2df3aa766d5ef30680880eea5a4abac120c1c6887c797793799a78",
                           "EndpointID": "f36353fdecacbe1f8220dce3c15adbe61cf307589e6d69ea01a2b71313c47aae",
                           "Gateway": "172.20.0.1",
                           "IPAddress": "172.20.0.2",
                           "IPPrefixLen": 16,
                           "IPv6Gateway": "",
                           "GlobalIPv6Address": "",
                           "GlobalIPv6PrefixLen": 0,
                           "MacAddress": "02:42:ac:14:00:02",
                           "DriverOpts": null
                       }
                   }
               }
       ```
   
 * Redis logs:
 *     ```
       redis         | 1:M 28 Mar 2021 17:09:58.587 - Accepted 172.20.0.5:59712
       redis         | 1:M 28 Mar 2021 17:09:58.588 - Client closed connection
       ```
   
 * PHP logs:
 *     ```
       php           | NOTICE: PHP message: RedisException: Connection refused in /var/www/html/wp-content/object-cache.php:578
       php           | Stack trace:
       php           | #0 /var/www/html/wp-content/object-cache.php(578): Redis->connect()
       php           | #1 /var/www/html/wp-content/object-cache.php(427): WP_Object_Cache->connect_using_phpredis()
       php           | #2 /var/www/html/wp-content/object-cache.php(173): WP_Object_Cache->__construct()
       php           | #3 /var/www/html/wp-includes/load.php(701): wp_cache_init()
       php           | #4 /var/www/html/wp-settings.php(131): wp_start_object_cache()
       php           | #5 /var/www/html/wp-config.php(104): require_once('/var/www/html/w...')
       php           | #6 /var/www/html/wp-load.php(37): require_once('/var/www/html/w...')
       php           | #7 /var/www/html/wp-admin/admin-ajax.php(22): require_once('/var/www/html/w...')
       php           | #8 {main}
       ```
   
 * Seems to be a problem of the plugin, because I can connect from php cli without
   problems (and authenticate too)
 * RESOLVED: wp config constants should be defined before loading other files
    -  This topic was modified 5 years, 2 months ago by [Kristiyan Katsarov](https://wordpress.org/support/users/katsar0v/).
    -  This topic was modified 5 years, 2 months ago by [Kristiyan Katsarov](https://wordpress.org/support/users/katsar0v/).
    -  This topic was modified 5 years, 2 months ago by [Kristiyan Katsarov](https://wordpress.org/support/users/katsar0v/).

The topic ‘Docker’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [Kristiyan Katsarov](https://wordpress.org/support/users/katsar0v/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/docker/)
 * Status: resolved