Actually, connection refused in WordPress error logs happens quite often and usually does not have a major impact on your website. However, since it is an error, sometimes we need to fix it before it becomes a bigger issue.
So why does this error occur?
This error usually happens because we are using Object Cache (Redis or Memcached), but the server we are using does not support Object Cache, or there is an issue with the object cache that requires the service to be restarted by the server administrator.
Now, for example, as hosting users, we certainly do not have access to restart the object cache. So, how do we fix it?
Of course, to eliminate this Connection Refused error in the error log, we can only disable the Object Cache feature in our WordPress site, so that our website does not need to try to access Redis or Memcached to store object cache.
How to Fix Connection Refused in WordPress Error Logs
Because object cache in WordPress can usually be disabled or enabled when using a plugin, we will discuss how to disable Object Cache in several popular plugins.
For this method, you can use the one that corresponds to the plugin you are using. If you are not using the plugin, you do not need to install any additional plugins.
1. Disabling Object Cache in LiteSpeed Cache
By default, object cache in LiteSpeed is already inactive. If you accidentally enabled it and a Connection Refused error appears in the error log, you can disable it using this method.
- Log in to your WordPress dashboard, then open the menu LiteSpeed Cache > Cache
- Next, on the cache settings page, open the tab Object
- If the status is On, change it to Off and save the changes.
- Congratulations, the Connection Refused error in your error log has stopped.
2. Disabling Object Cache in Redis Object Cache
If you are using the plugin Redis Object Cache, you can directly uninstall the plugin to stop the connection refused error, or you can disable the Redis object cache feature using this method.
- Log in to your WordPress dashboard and open the menu Settings > Redis
- On the Redis page, click the button Disable Object Cache to disable the object cache.
- Congratulations, your object cache has now been successfully disabled without uninstalling the plugin.
3. Disabling Object Cache in W3 Total Cache
Besides the two plugins above, you can also enable and disable object cache if you are using the plugin W3 Total Cache. To disable it, you can follow these steps:
- Log in to your admin dashboard, then open the menu Performance > General Settings
- Scroll down until you find the option Page Cache
- If your page cache is still using Redis, you can disable that option or change it to Disk or Disk: Enhanced
- Save the changes and clear the cache to disable Redis.
Those are some ways to disable Redis so that the Connection Refused error in your error log file stops. Is the plugin you are using not on the list? It is possible that the plugin has not added an Object Cache feature, or I have not tried it yet.
Conclusion
This Connection Refused error is usually caused by enabling object cache when your server does not provide the object cache feature or there is a problem with the object cache on the server. For a solution, if you are a server owner, you can try to restart the Redis Service. If you are a hosting user, you can disable the Object Cache feature on your website.
COMMENTS
Loading...