How to Fix Connection Refused in WordPress Error Logs

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.

Cara Mengatasi Connection Refused di Error Log WordPress

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.

  1. Log in to your WordPress dashboard, then open the menu LiteSpeed Cache > Cache
    Cara Mengatasi Connection Refused di Error Log WordPress - 1-1
  2. Next, on the cache settings page, open the tab Object
    Cara Mengatasi Connection Refused di Error Log WordPress - 1-2
  3. If the status is On, change it to Off and save the changes.
    Cara Mengatasi Connection Refused di Error Log WordPress - 1-3
  4. 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.

  1. Log in to your WordPress dashboard and open the menu Settings > Redis
    Cara Mengatasi Connection Refused di Error Log WordPress - 2-1
  2. On the Redis page, click the button Disable Object Cache to disable the object cache.
    Cara Mengatasi Connection Refused di Error Log WordPress - 2-2
  3. 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:

  1. Log in to your admin dashboard, then open the menu Performance > General Settings
    Cara Mengatasi Connection Refused di Error Log WordPress - 3-1
  2. Scroll down until you find the option Page Cache
    Cara Mengatasi Connection Refused di Error Log WordPress - 3-2
  3. If your page cache is still using Redis, you can disable that option or change it to Disk or Disk: Enhanced
    Cara Mengatasi Connection Refused di Error Log WordPress - 3-3
  4. 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.

Written by

Muhammad Khoirun Nasikin

I enjoy tinkering with WordPress, hosting, VPS, web development, and various small experiments related to websites. I have over 3 years of experience in the web hosting industry.

COMMENTS

Loading...