How to fix cURL error 28: Connection timed out after X milliseconds Print

  • 0

CURL is a software utility. We can use it for WordPress and other web applications to send/receive the data requests using URLs. In WordPress, we can use cURL to handle API requests. Curl is available as an extension in the PHP. Curl library plays a significant role in how Wordpress works. If the curl is not configured correctly, you may face an issue with your Wordpress website functionality.

What Causes cURL error 28 in WordPress?

You may receive the cURL error 28 when the Wordpress website fails to respond to the server's data requests. WordPress uses REST API to send/receive data requests. If you expand the detailed error, you can find the below error message.

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

How can we fix the Wordpress error: curl error 28: Connection timed out

1. Temporarily Disable WordPress Firewall

If you are using a Wordpress firewall or any other security plugin, you can temporarily deactivate it. You can also check the Wordpress firewall logs to find out which API request is blocking. Once you find it, you can adjust your firewall settings to allow legitimate API requests.

2. Deactivate All WordPress Plugins

Wordpress plugins use API calls to send/receive data. If any data request takes a long time, it may cause the cURL 28 error. To verify which plugin is causing this issue, you can first disable all the Wordpress plugins. Please refer to how to disable Wordpress plugins. After that, you can verify the site health report. If it is disappeared, you can enable the plugins one by one until the error occurs again. Once you find the plugin causing the issue, you can keep it disable to fix the issue.

3. Fix SSL Insecure Content Issues

If you have redirected the Wordpress website to HTTPS, but if the SSL setup is incorrect, you face the below cURL error.

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

You can reinstall the SSL Certificate to fix this issue. Please refer to how to install Auto SSL on WHM/cPanel.

4. Use Latest PHP & Curl version

You need to ensure that you are using the compatible and latest version of PHP & CURL. Are you looking to change the PHP version from cPanel? Please refer to how to change the PHP version in cPanel.


Was this answer helpful?

« Back
Sign up for a newsletter

chat