Hello @vmarko
I hooked up the radis without using this config.
And there was a log of endless attempts to connect to redis on localhost
I tried to add it (/wp-content/plugins/w3-total-cache/ini/config-db.php
, right?) — nothing changed.
Below is the content of the configuration that I made
define('W3TC_CONFIG_DATABASE', true);
define('W3TC_CONFIG_CACHE_ENGINE', 'redis');
define('W3TC_CONFIG_CACHE_REDIS_SERVERS', 'redis:6379');
define('W3TC_CONFIG_CACHE_REDIS_VERIFY_TLS_CERTIFICATES', false);
Using the command tcpdump -i any port 6379
inside the container with WP, I get a long log of how the plugin tries to check the connection to redis and fails to find it (a successful connection to another redis is also visible, there the data exchange is normal)
After disabling the w3tc plugin, this log is gone
17:10:17.773500 lo In IP localhost.60380 > localhost.6379: Flags [S], seq 599777928, win 65495, options [mss 65495,sackOK,TS val 1088607838 ecr 0,nop,wscale 7], length 0
17:10:17.773504 lo In IP localhost.6379 > localhost.60380: Flags [R.], seq 0, ack 1437402834, win 0, length 0
17:10:17.775904 lo In IP localhost.60396 > localhost.6379: Flags [S], seq 2333168516, win 65495, options [mss 65495,sackOK,TS val 1088607840 ecr 0,nop,wscale 7], length 0
17:10:17.775909 lo In IP localhost.6379 > localhost.60396: Flags [R.], seq 0, ack 610208718, win 0, length 0
17:10:17.777802 lo In IP localhost.60404 > localhost.6379: Flags [S], seq 3700970019, win 65495, options [mss 65495,sackOK,TS val 1088607842 ecr 0,nop,wscale 7], length 0
17:10:17.777806 lo In IP localhost.6379 > localhost.60404: Flags [R.], seq 0, ack 551556151, win 0, length 0
17:10:17.777867 lo In IP localhost.60406 > localhost.6379: Flags [S], seq 2215180403, win 65495, options [mss 65495,sackOK,TS val 1088607842 ecr 0,nop,wscale 7], length 0
17:10:17.777870 lo In IP localhost.6379 > localhost.60406: Flags [R.], seq 0, ack 2025716921, win 0, length 0
I tried making changes to the following files, but still attempts to connect to localhost remain
/plugins/w3-total-cache/ini/config-db-sample.php
/plugins/w3-total-cache/ini/config-db.php
/plugins/w3-total-cache/Extension_FragmentCache_Plugin.php
/plugins/w3-total-cache/ConfigKeys.php
/w3tc-config/master.php - After saving the settings in the admin, the file is overwritten. After making my changes, it still doesn't take them into consideration(
Also I tried to get more information for you, I modified the Redis_Cache.php file by adding my code to it
error_log("================================");
error_log("Config - " . json_encode($config));
error_log("================================");
...
error_log("================================");
error_log("Key - " . json_encode($key));
error_log("Accessors - " . json_encode($this->_accessors));
error_log("Servers - " . json_encode($this->_servers));
error_log("Redis server - $server");
error_log("================================");
Below is an example of output, when exactly the plugin knocks on localhost, it turns out redis caching is not working correctly, because it still tries to look for values on localhost for DB Cache and Object Cache caching.
NOTICE: PHP message: ================================
NOTICE: PHP message: Config - {"servers":["127.0.0.1:6379"],"verify_tls_certificates":true,"persistent":true,"timeout":0,"retry_interval":0,"read_timeout":0,"dbid":0,"password":"","blog_id":0,"module":"object","host":"debug.roses.ee","instance_id":219741501}
NOTICE: PHP message: ================================
NOTICE: PHP message: ================================
NOTICE: PHP message: Key - "w3tc_219741501_debug.roses.ee_0_object_0defaultis_blog_installed"
NOTICE: PHP message: Accessors - []
NOTICE: PHP message: Servers - ["127.0.0.1:6379"]
NOTICE: PHP message: Redis server - 127.0.0.1:6379
NOTICE: PHP message: ================================
NOTICE: PHP message: ================================
NOTICE: PHP message: Key - "w3tc_219741501_debug.roses.ee_0_object_0optionsalloptions"
NOTICE: PHP message: Accessors - [null]
NOTICE: PHP message: Servers - ["127.0.0.1:6379"]
NOTICE: PHP message: Redis server - 127.0.0.1:6379
NOTICE: PHP message: ================================
...
NOTICE: PHP message: ================================
NOTICE: PHP message: Config - {"servers":["redis:6379"],"verify_tls_certificates":true,"persistent":true,"dbid":0,"password":"","timeout":0,"retry_interval":0,"read_timeout":0,"key_version_mode":"disabled","blog_id":"0","module":"config","host":"","instance_id":0}
NOTICE: PHP message: ================================
NOTICE: PHP message: ================================
NOTICE: PHP message: Key - "w3tc_0__0_config_w3tc_config_0"
NOTICE: PHP message: Accessors - []
NOTICE: PHP message: Servers - ["redis:6379"]
NOTICE: PHP message: Redis server - redis:6379
NOTICE: PHP message: ================================
...
NOTICE: PHP message: ================================
NOTICE: PHP message: Config - {"servers":["127.0.0.1:6379"],"verify_tls_certificates":true,"persistent":true,"timeout":0,"retry_interval":0,"read_timeout":0,"dbid":0,"password":"","module":"dbcache","host":"debug.roses.ee","instance_id":219741501,"blog_id":0}
NOTICE: PHP message: ================================
NOTICE: PHP message: ================================
NOTICE: PHP message: Key - "w3tc_219741501_0_dbcache_options_key_version"
NOTICE: PHP message: Accessors - []
NOTICE: PHP message: Servers - ["127.0.0.1:6379"]
NOTICE: PHP message: Redis server - 127.0.0.1:6379
NOTICE: PHP message: ================================
NOTICE: PHP message: ================================
NOTICE: PHP message: Key - "w3tc_219741501_debug.roses.ee_0_object_0optionscron"
NOTICE: PHP message: Accessors - [null]
NOTICE: PHP message: Servers - ["127.0.0.1:6379"]
NOTICE: PHP message: Redis server - 127.0.0.1:6379
NOTICE: PHP message: ================================
NOTICE: PHP message: ================================
NOTICE: PHP message: Key - "w3tc_219741501_debug.roses.ee_0_object_0optionsalloptions"
NOTICE: PHP message: Accessors - [null]
NOTICE: PHP message: Servers - ["127.0.0.1:6379"]
NOTICE: PHP message: Redis server - 127.0.0.1:6379
NOTICE: PHP message: ================================
Is it coming out that the plugin can’t be configured to a custom host at this point? Or how can I do that?
No matter what I try, I get the same result, the plugin knocks on localhost
Maybe you can tell me where I’m wrong, or what I need to fix.
Or where these settings for each plugin are pulled from, where the localhost is specified.
I really need help with the correct configuration.
Even if I have to change something in the plugin files, or in the database.