If you are a web designer and you 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. It may cause unforeseen disruptions to your site. 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. In fact, WordPress uses this software to respond to API requests. This 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 properly.
CURL Error 28: Connection Timed Out
You may be looking for the cause of this error. Needless to say, this 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.
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 problem 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.
The second method is to disable any plugins you have running on WordPress. Because these plugins also send their requests, and 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 make sure 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. Now 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. Causes your web server 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. If 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 cURL 28 error after completing the above steps. Most likely the problem is with your hosting provider. In fact, there are so many important factors that are only available to the web host (the company from which you provided them) and you can not control and fix them. For example, if your site’s 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.