Gaming & Tech
How to Fix cURL Error 28: Connection Timed Out in WordPress
How to Fix cURL Error 28: Connection Timed Out in WordPress
cURL Error 28 occurs when a request made by WordPress to an external server takes too long and eventually times out. This can affect various functionalities like plugin updates, API requests, and even your site’s performance. Here’s how to fix it:
Need More Tech Help – Download the URBT News App
1. Check Your Server’s DNS Settings
Ensure your DNS settings are correctly configured. Misconfigured DNS can slow down requests, leading to timeouts.
You can use a public DNS like Google DNS (8.8.8.8 and 8.8.4.4) or Cloudflare DNS (1.1.1.1 and 1.0.0.1).
2. Increase PHP Execution Time
Increase the max_execution_time
in your php.ini
file. This setting controls how long a PHP script can run before it is terminated. A longer execution time might prevent timeouts.
max_execution_time = 300
3. Optimize Your WordPress Site
Disable unnecessary plugins or themes that might be making multiple external requests. Ensure that your site isn’t bloated with unnecessary content that could be slowing down server response times.
4. Update cURL Version
Ensure that the cURL version on your server is up to date. An outdated version can lead to compatibility issues and errors.
You can check the version by running:
curl --version
Update using your package manager:
sudo apt-get update && sudo apt-get upgrade curl
5. Check WordPress REST API Status
Sometimes, cURL Error 28 is related to issues with the WordPress REST API. Navigate to Tools > Site Health in your WordPress dashboard and check for REST API issues. Resolve any issues that are flagged here.
6. Firewall and Security Plugins
Sometimes security plugins or server firewalls can block outgoing requests, leading to timeouts. Temporarily disable any security plugins and test again.
If you suspect your firewall, contact your hosting provider to whitelist specific IPs or disable certain rules temporarily.
7. Contact Your Hosting Provider
If the issue persists, it might be related to your hosting environment. Contact your hosting provider to check if there are any server-level issues, such as network slowdowns or firewall restrictions.
Additional Tips:
- Monitor Logs: Check your server logs for any specific errors that could give more insight into the timeout issue.
- Use WP-CLI: If you have command line access, use WP-CLI to run updates or other operations that might be failing due to cURL error 28. This bypasses potential issues with the web interface.
Download the URBT News App from your App store. Apple / Andriod
How to Fix cURL Error 28
Discover more from URBT News
Subscribe to get the latest posts sent to your email.