How to fix CURL Error 28: Connection Timed Out

How to fix CURL Error 28: Connection Timed Out

Suppose you are a web designer and spend a lot of time in the WordPress environment every day. You may encounter cURL Error 28: Connection Timed Out. This error is one of the most common problems in WordPress. In this article, we will discuss ways to solve this problem.

What is cURL

cURL is software that is used in WordPress and many other web applications. This software is used to send and receive data requests via URL. WordPress uses this software to respond to API requests. cURL is an extension for the PHP programming language, and your host is responsible for protecting and supporting it. If you do not configure cURL properly, your WordPress website will crash and may not work correctly.

CURL Error 28: Connection Timed Out

You may be looking for the cause of this error. The error happens when your server does not respond to requests on time. WordPress uses a programming method called REST API to send and receive data requests. If the time for responding to these requests expires; You will see REST API Encountered in Error in the health section of your site. This message will be displayed to you when this error spreads:

Error: cURL error 28: Operation timed out after x milliseconds with x bytes received (http_request_failed)

In this case, you may encounter another error telling you that your site is not responding to a return request or is unable to complete the process. In such cases, you will probably see an error similar to this one:

The loopback request to your site failed; this means features relying on them are not currently working as expected.

Factors

Some of the factors that cause WordPress cURL to crash:

  • Some wordpress firewall plugins may prevent you from requesting the REST API. This is because the REST API plugin is considered suspicious activity.
  • The next case may be due to your DNS server. If your DNS server is not working properly, it may cause some issues such as unsuccessful HTTP requests and eventually time out error in wordpress.

How to Solve cURL Error 28: Connection Timed Out

There are several ways to solve this problem that you can use if necessary:

Disable the firewall

First of all, if you are using a firewall or security plugin in WordPress, it is better to disable it for a while and then go to the health page of your site and check if the problem is solved or not. If the issue is resolved, you should check the logins in your WordPress firewall and find the blocked account. By doing this, you will find the source of the problem and problem, and according to it, you can make firewall settings to prevent the blocking of legal APIs.

Disable plugins

The second method is to disable any plugins you have running on WordPress. Because these plugins also send their requests, sometimes you may see a cURL error due to sending many requests and back. The easiest way to find out is to go to the installed plugins section and select and disable all plugins. Now go to the health section of your site, and if you visit the site without any problems, you will notice that the problem was with the plugins. Activate them one by one to re-create the problem and find the plugin that caused the problem. You can then investigate the plugin that caused this problem and fix the problem.

Updated versions of PHP, cURL, OpenSSL

The next step is to ensure your site server is running the latest version of PHP, cURL, and OpenSSL. To find out about this from the WordPress menu, from the Tools section, click on Site Health. When you enter the health page of your site, go to the information section. Then click on the server option. From this section, you can easily find out what version of PHP, cURL, and OpenSSL your server is using if you notice that your site server is not using new and updated versions. You should contact your hosting company and ask them to increase these versions for you.

Troubleshoot SSL insecure content

If you have an SSL certificate for your site and you do not configure it properly. It causes your webserver to block insecure cURL requests. That’s why you need to make sure your SSL certificate is configured correctly. Even if your site does not have an SSL certificate, you may encounter the following error.

‘Error: cURL error 7: Failed to connect to localhost port 443: Connection refused (http_request_failed)

You can also tick your hosting company to solve this problem. Request that an SSL certificate is installed on your site. Suppose this error persists after installing SSL. Send a ticket to your hosting and ask to follow the reason for this error.

Error not resolved? Contact your host.

If your site still gives a cURL 28 error after completing the above steps. Most likely, the problem is with your hosting provider. There are so many essential factors only available to the web host, and you can not control and fix them. For example, if your web servers fail to resolve your requests, the site will encounter this error.

We hope this article has helped you fix the cURL 28 error. Also, if you have any experience in this field, let us know in the comments below.

Good luck.

Is there any particular point that would complete this article?

  1. Guest User February 28, 2022

    Hi! I just wanted to ask if you ever have any issues with hackers? My last blog (wordpress) was hacked and I ended up losing many months of hard work due to no back up. Do you have any methods to prevent hackers?

    • Reza Rad Reza Rad March 4, 2022

      Hi. There are several ways to prevent hackers. It would help if you learned WordPress security methods.