Приветствуем вас! Вы видите ошибку cURL 28: Превышено время ожидания соединения на вашем сайте WordPress? Ошибка cURL 28 — распространенная проблема WordPress REST API, которая может повлиять на производительность вашего веб-сайта и привести к его непредсказуемому поведению.
В этой статье мы покажем вам, как легко исправить проблему cURL error 28 на вашем веб-сайте WordPress.
Что такое cURL в WordPress?
CURL — это программная утилита, используемая WordPress и многими другими веб-приложениями для отправки и получения запросов данных с использованием URL-адресов.
WordPress использует cURL для обработки нескольких запросов API. Он доступен как расширение языка программирования PHP, и ваша хостинговая компания WordPress позаботится об этом.
Библиотека cURL играет решающую роль в том, как WordPress работает за кулисами. Если он не настроен должным образом, ваш веб-сайт не будет работать должным образом.
Что вызывает ошибку cURL 28 в WordPress?
Неспособность своевременно ответить на запросы данных сервера вызывает ошибку 28 cURL в WordPress.
WordPress использует REST API (метод программирования) для отправки и получения запросов данных. Если время ожидания этих запросов истекло, вы увидите это как критическую проблему в отчете о работоспособности сайта с заголовком «Ошибка REST API».
Расширение ошибки покажет вам дополнительную информацию, включая сообщение об ошибке:
Error: cURL error 28: Operation timed out after x milliseconds with x bytes received (http_request_failed)
Вы также можете увидеть другую связанную проблему с заголовком «Ваш сайт не может выполнить запрос обратной связи». В нем будет аналогичное сообщение об ошибке со следующим описанием.
«Запрос обратной связи к вашему сайту не удался, это означает, что функции, использующие их, в настоящее время не работают должным образом».
Что может вызвать тайм-аут cURL?
Ряд сценариев может вызвать тайм-аут cURL в WordPress:
- Например, плагин брандмауэра WordPress может блокировать запрос REST API, считая его подозрительным действием.
- Если ваш DNS-сервер работает некорректно, это также может вызвать сбой HTTP-запросов и вызвать ошибку тайм-аута cURL в WordPress.
- Плохо настроенный хостинг-сервер может просто иметь очень низкий порог тайм-аута, что может помешать правильной работе определенных процессов WordPress.
Давайте посмотрим, как устранить и исправить данную проблему.
1. Временно отключите брандмауэр WordPress
Если вы используете брандмауэр WordPress или плагин безопасности, временно отключите его.
После этого вам нужно посетить страницу отчета о работоспособности сайта WordPress, чтобы узнать, решена ли ваша проблема.
Если да, то вам нужно проверить журналы брандмауэра WordPress, чтобы узнать, какие запросы API были заблокированы. Это либо определит источник проблемы, либо вы можете настроить параметры брандмауэра, чтобы не блокировать законные запросы API.
2. Отключите все плагины WordPress
Плагины WordPress создают собственные запросы API для отправки и получения данных. Если эти вызовы слишком часты или для выполнения требуется слишком много времени, это может вызвать ошибку cURL в отчете о работоспособности вашего сайта.
Самый простой способ выяснить это — отключить все плагины WordPress. Просто перейдите на страницу «Плагины»-«Установленные» и выберите все плагины.
После этого щелкните раскрывающееся меню «Массовые действия», чтобы выбрать «Деактивировать», а затем нажмите кнопку «Применить».
Теперь вы можете посетить отчет о работоспособности сайта, чтобы узнать, исчезла ли проблема. Если это устранило проблему, вы можете активировать свои плагины один за другим, пока проблема не появится снова.
Это поможет вам найти плагин, который может вызывать проблему.
3. Убедитесь, что ваш хостинг-сервер использует новейшее программное обеспечение
Следующий шаг — убедиться, что ваш хостинг-сервер WordPress использует последние версии PHP, библиотеки cURL и OpenSSL.
Вы можете проверить это, просмотрев вкладку системной информации на странице «Инструменты»-«Здоровье сайта».
Просто перейдите на вкладку «Информация» и разверните раздел «Сервер». Отсюда вы можете получить информацию о программном обеспечении, установленном на вашем хостинг-сервере WordPress.
В идеале ваш сервер должен использовать PHP 7.4.13 или выше, curl 7.74.0 или выше и OpenSSL 1.1.1 или выше.
Если это не так, вам необходимо связаться с вашей хостинговой компанией и попросить их обновить программное обеспечение для вашей учетной записи хостинга.
4. Устранение проблем с небезопасным контентом SSL
Если ваш сайт использует HTTPS / SSL, но он не настроен должным образом, это также может привести к тому, что ваш веб-сервер заблокирует небезопасные запросы cURL.
Точно так же, если ваш веб-сайт не использует HTTPS / SSL, но он сделал вызов API с использованием URL-адреса HTTP, то эти запросы тоже не будут выполнены, и вместо этого вы можете увидеть следующую ошибку cURL:
Ошибка: ошибка cURL 7: не удалось подключиться к порту localhost 443: в соединении отказано (http_request_failed)
Чтобы исправить это, вы можете попросить своего хостинг-провайдера переустановить сертификат SSL для вашего сайта.
5. Обратитесь за помощью к поставщику услуг хостинга
Если описанные выше действия не помогли устранить ошибку cURL 28 то, проблема, скорее всего, связана с средой хостинга.
Есть много факторов, которые могут контролироваться и исправляться только вашей хостинговой компанией. Например, если их DNS-серверы не могут своевременно разрешать запросы, это приведет к тайм-ауту запросов cURL.
Другой сценарий может заключаться в более медленном подключении или сетевых проблемах с вашим хост-сервером.
Просто отправьте им запрос в службу поддержки с подробными сведениями об ошибке, и их технический персонал сможет устранить неполадки и применить исправление для ее решения. Ну что, у нас на этом все. Всем пока!
С уважением Вячеслав и Валерия!
Понравился материал? Поделитесь с друзьями!
Интересное на блоге
Содержание
- How to fix cURL error 28: Connection timed out after X milliseconds
- What is cURL in WordPress?
- What Causes cURL error 28 in WordPress?
- 1. Temporarily Disable WordPress Firewall
- 2. Deactivate All WordPress Plugins
- 3. Ensure Your Hosting Server is Using the Latest Software
- 4. Fix SSL Insecure Content Issues
- 5. Seek Help from Hosting Provider
- WordPress на русском
- Канал на YouTube
- Реклама
- Популярные записи
- Свежие записи
- Свежие комментарии
- Как исправить ошибку «cURL error 28: Connection timed out» при обновлении WordPress
- Как исправить ошибку?
- Как исправить ошибку cURL 28: время ожидания соединения истекло
How to fix cURL error 28: Connection timed out after X milliseconds
Last updated on January 5th, 2021 by Editorial Staff | Reader Disclosure Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.
Are you seeing the cURL error 28: Connection timed out error on your WordPress site?
The cURL error 28 is a common WordPress REST API issue that can affect your website’s performance and may cause it to behave unpredictably.
In this article, we will show you how to easily fix the ‘cURL error 28: Connection timed out’ issue on your WordPress website.
What is cURL in WordPress?
The cURL is a software utility used by WordPress and many other web applications to send and receive data requests using URLs.
WordPress uses cURL to handle several API requests. It is available as an extension of the PHP programming language, and your WordPress hosting company takes care of that.
The cURL library plays a crucial role in how WordPress works behind the scenes. If it is not configured properly, then your WordPress website will not function properly.
What Causes cURL error 28 in WordPress?
Failure to respond back to the server’s data requests in a timely manner causes cURL error 28 in WordPress.
WordPress uses REST API (a programming technique) to send and receive data requests. If these requests time out, then you’ll see it as a critical issue in the Site Health report with the title ‘The REST API encountered in error’.
Expanding the error will show you further details including the error message:
Error: cURL error 28: Operation timed out after x milliseconds with x bytes received (http_request_failed)
You may also see another related issue with the title ‘Your site could not complete a loopback request’. It will have a similar error message with the following description.
‘The loopback request to your site failed, this means features relying on them are not currently working as expected.’
What may cause cURL to timeout?
A number of scenarios may cause the cURL to time out in WordPress.
For instance, a WordPress firewall plugin may block a REST API request considering it to be a suspicious activity.
If your DNS server is not working correctly, then this may also fail HTTP requests and cause the cURL timeout error in WordPress.
A poorly configured WordPress hosting server may simply have a very low timeout threshold which may stop certain WordPress processes to run properly.
That being said, let’s take a look at how to troubleshoot and fix the ‘curl error 28: Connection timed out’ issue in WordPress.
1. Temporarily Disable WordPress Firewall
If you are using a WordPress firewall or a security plugin, then go ahead and temporarily deactivate it.
After that, you need to visit the WordPress site health report page to see if your issue has resolved.
If it has, then you need to check your WordPress firewall logs to see which API requests have been blocked.
This would either identify the source of the issue or you can adjust firewall settings to not block legitimate API requests.
2. Deactivate All WordPress Plugins
WordPress plugins make their own API requests to send and receive data. If these calls are too frequent or take too long to complete, then this may cause the cURL error in your site health report.
The easiest way to figure this out is by deactivating all WordPress plugins. Simply go to the Plugins » Installed Plugins page and select all plugins.
After that, click on the Bulk Actions drop down to select ‘Deactivate’ and then click on the ‘Apply’ button.
You can now visit the Site Health report to see if the issue has disappeared. If this resolved the issue, then you can start activating your plugins one by one until the issue reappears.
This will help you find the plugin that may be causing the issue and you can then ask the plugin author for support.
3. Ensure Your Hosting Server is Using the Latest Software
The next, step is to make sure that your WordPress hosting server is using the latest versions of PHP, cURL library, and OpenSSL.
You can check that by looking at the system information tab under Tools » Site Health page.
Simply switch to the ‘Info’ tab and expand the ‘Server’ section. From here you can get the information about software installed on your WordPress hosting server.
Ideally, your server should be using PHP 7.4.13 or higher, curl 7.74.0 or higher, and OpenSSL 1.1.1 or higher.
If it doesn’t, then you need to contact your WordPress hosting company and request them to update the software for your hosting account.
4. Fix SSL Insecure Content Issues
If your WordPress site is using HTTPS / SSL, but it is not configured properly, then this could also lead your web server to block insecure cURL requests.
Similarly, if your WordPress site doesn’t use HTTPS / SSL, but it made an API call using an HTTPs URL, then those requests will fail too, and you may see the following cURL error instead:
‘Error: cURL error 7: Failed to connect to localhost port 443: Connection refused (http_request_failed)
To fix this, you can ask your hosting provider to re-install SSL certificate for your website. If the issue persists, then follow our guide on how to fix common SSL issues to properly set up SSL on your WordPress website.
5. Seek Help from Hosting Provider
If the above steps fail to resolve the cURL error 28 on your WordPress site, then the problem is most likely a hosting environment issue.
There are many factors that can only be controlled and fixed by your hosting company. For instance, if their DNS servers are unable to resolve requests in a timely manner, then this will cause cURL requests to timeout.
Another scenario could be slower connectivity or networking issues with your hosting server.
Simply drop them a support request with the error details and their technical staff can troubleshoot and apply a fix to solve it.
We hope this article helped you learn how to fix the cURL error 28 in WordPress. You may also want to bookmark our WordPress troubleshooting tips and our ultimate handbook on fixing common WordPress errors.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Источник
WordPress на русском
Канал на YouTube
Реклама
Популярные записи
Свежие записи
Свежие комментарии
- Kos к записи Как включить автоматическое обновление плагинов в WordPress
- Борис к записи Как ускорить сайт на WordPress
- lyrics к записи Похоже, в вашей конфигурации PHP отсутствует расширение MySQL, необходимое для работы WordPress.
- ildar r. khasanshin к записи Как очистить сайт на WordPress, если его взломали
- Как очистить сайт на WordPress, если его взломали — WordPress на русском к записи Как создать дочернюю тему WordPress
Как исправить ошибку «cURL error 28: Connection timed out» при обновлении WordPress
В этой короткой статье мы расскажем, как устранить ошибку «cURL error 28: Connection timed out in XXXX milliseconds» при обновлении плагинов или тем WordPress. Это довольно распространённая ошибка, и связана она с сервером. В большинстве случаев она не вызывается ни какой-либо темой, ни плагином, и не самим WordPress.
Как исправить ошибку?
Первое, что нужно сделать, это обновить WordPress до актуальной версии.
Если это не помогло решить проблему, свяжитесь с поддержкой вашего хостинг-провайдера и уточните следующие моменты:
- Убедитесь, что на сервере работает последняя версия PHP и библиотеки cURL.
- Попробуйте увеличить параметр лимита памяти сервера (memory_limit).
- Эта ошибка cURL может быть связана с проблемами, связанными с DNS. Если вы используете собственный сервер, попробуйте переключить конфигурацию на OpenDNS.
- Уточните у провайдера, нет ли ограничений на выполнение wp-cron и не отключен ли loopback.
- Уточните у провайдера, возможно, брэндмауэр или модули защиты (например, mod_security ) блокируют исходящие запросы cURL.
Источник
Как исправить ошибку cURL 28: время ожидания соединения истекло
Приветствуем вас! Вы видите ошибку cURL 28: Превышено время ожидания соединения на вашем сайте WordPress? Ошибка cURL 28 — распространенная проблема WordPress REST API, которая может повлиять на производительность вашего веб-сайта и привести к его непредсказуемому поведению.
В этой статье мы покажем вам, как легко исправить проблему cURL error 28 на вашем веб-сайте WordPress.
Что такое cURL в WordPress?
CURL — это программная утилита, используемая WordPress и многими другими веб-приложениями для отправки и получения запросов данных с использованием URL-адресов.
WordPress использует cURL для обработки нескольких запросов API. Он доступен как расширение языка программирования PHP, и ваша хостинговая компания WordPress позаботится об этом.
Библиотека cURL играет решающую роль в том, как WordPress работает за кулисами. Если он не настроен должным образом, ваш веб-сайт не будет работать должным образом.
Что вызывает ошибку cURL 28 в WordPress?
Неспособность своевременно ответить на запросы данных сервера вызывает ошибку 28 cURL в WordPress.
WordPress использует REST API (метод программирования) для отправки и получения запросов данных. Если время ожидания этих запросов истекло, вы увидите это как критическую проблему в отчете о работоспособности сайта с заголовком «Ошибка REST API» .
Расширение ошибки покажет вам дополнительную информацию, включая сообщение об ошибке:
Error: cURL error 28: Operation timed out after x milliseconds with x bytes received (http_request_failed)
Вы также можете увидеть другую связанную проблему с заголовком «Ваш сайт не может выполнить запрос обратной связи» . В нем будет аналогичное сообщение об ошибке со следующим описанием.
«Запрос обратной связи к вашему сайту не удался, это означает, что функции, использующие их, в настоящее время не работают должным образом».
Что может вызвать тайм-аут cURL?
Ряд сценариев может вызвать тайм-аут cURL в WordPress:
- Например, плагин брандмауэра WordPress может блокировать запрос REST API, считая его подозрительным действием.
- Если ваш DNS-сервер работает некорректно, это также может вызвать сбой HTTP-запросов и вызвать ошибку тайм-аута cURL в WordPress.
- Плохо настроенный хостинг-сервер может просто иметь очень низкий порог тайм-аута, что может помешать правильной работе определенных процессов WordPress.
Давайте посмотрим, как устранить и исправить данную проблему.
1. Временно отключите брандмауэр WordPress
Если вы используете брандмауэр WordPress или плагин безопасности, временно отключите его.
После этого вам нужно посетить страницу отчета о работоспособности сайта WordPress, чтобы узнать, решена ли ваша проблема.
Если да, то вам нужно проверить журналы брандмауэра WordPress, чтобы узнать, какие запросы API были заблокированы. Это либо определит источник проблемы, либо вы можете настроить параметры брандмауэра, чтобы не блокировать законные запросы API.
2. Отключите все плагины WordPress
Плагины WordPress создают собственные запросы API для отправки и получения данных. Если эти вызовы слишком часты или для выполнения требуется слишком много времени, это может вызвать ошибку cURL в отчете о работоспособности вашего сайта.
Самый простой способ выяснить это — отключить все плагины WordPress. Просто перейдите на страницу «Плагины»-«Установленные» и выберите все плагины.
После этого щелкните раскрывающееся меню «Массовые действия» , чтобы выбрать «Деактивировать» , а затем нажмите кнопку «Применить» .
Теперь вы можете посетить отчет о работоспособности сайта, чтобы узнать, исчезла ли проблема. Если это устранило проблему, вы можете активировать свои плагины один за другим, пока проблема не появится снова.
Это поможет вам найти плагин, который может вызывать проблему.
3. Убедитесь, что ваш хостинг-сервер использует новейшее программное обеспечение
Следующий шаг — убедиться, что ваш хостинг-сервер WordPress использует последние версии PHP, библиотеки cURL и OpenSSL.
Вы можете проверить это, просмотрев вкладку системной информации на странице «Инструменты»-«Здоровье сайта» .
Просто перейдите на вкладку «Информация» и разверните раздел «Сервер» . Отсюда вы можете получить информацию о программном обеспечении, установленном на вашем хостинг-сервере WordPress.
В идеале ваш сервер должен использовать PHP 7.4.13 или выше, curl 7.74.0 или выше и OpenSSL 1.1.1 или выше.
Если это не так, вам необходимо связаться с вашей хостинговой компанией и попросить их обновить программное обеспечение для вашей учетной записи хостинга.
4. Устранение проблем с небезопасным контентом SSL
Если ваш сайт использует HTTPS / SSL, но он не настроен должным образом, это также может привести к тому, что ваш веб-сервер заблокирует небезопасные запросы cURL.
Точно так же, если ваш веб-сайт не использует HTTPS / SSL, но он сделал вызов API с использованием URL-адреса HTTP, то эти запросы тоже не будут выполнены, и вместо этого вы можете увидеть следующую ошибку cURL:
Ошибка: ошибка cURL 7: не удалось подключиться к порту localhost 443: в соединении отказано (http_request_failed)
Чтобы исправить это, вы можете попросить своего хостинг-провайдера переустановить сертификат SSL для вашего сайта.
5. Обратитесь за помощью к поставщику услуг хостинга
Если описанные выше действия не помогли устранить ошибку cURL 28 то, проблема, скорее всего, связана с средой хостинга.
Есть много факторов, которые могут контролироваться и исправляться только вашей хостинговой компанией. Например, если их DNS-серверы не могут своевременно разрешать запросы, это приведет к тайм-ауту запросов cURL.
Другой сценарий может заключаться в более медленном подключении или сетевых проблемах с вашим хост-сервером.
Просто отправьте им запрос в службу поддержки с подробными сведениями об ошибке, и их технический персонал сможет устранить неполадки и применить исправление для ее решения. Ну что, у нас на этом все. Всем пока!
Источник
THIS HAS BEEN SOLVED — SEE ANSWER AT THE END OF THIS POST
I am trying to retrieve data from a remote server using PHP / cURL
If I put the following URL into a browser the data comes back correctly.
http://realm103.c7.castle.wonderhill.com/api/map.json?user%5Fid=5245274&x=375&y=375×tamp=1310554325&%5Fsession%5Fid=5b2070a46a083a33e053d60dbc2d062e&dragon%5Fheart=098d2deb0a37f18c97428d636c456572f9bade24&version=3
However when I try to access if with PHP / cURL it just times out (error code 28).
$json = curl($jsonurl, $realm['intRealmID'], $realm['strRealmServer']);
function curl($url, $realm, $realmServer){
$header = array();
$header[] = 'Host: realm'.strval($realm).'.'.$realmServer.'.castle.wonderhill.com';
$header[] = 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
$header[] = 'Accept-Language: en-us,en;q=0.5';
$header[] = 'Accept-Encoding: gzip,deflate';
$header[] = 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7';
$header[] = 'Connection: keep-alive';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0');
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_ENCODING, '');
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
return curl_exec($ch);
curl_close($ch);
}
Anybody have any ideas why it works from the browser but not via cURL? Thanks
ADDITIONAL INFO
Whilst cURL isn’t working for the URL above. For the URL below it works just fine. The only difference is the server the data is being requested from. The data itself and POST is identical.
http://realm4.c5.castle.wonderhill.com/api/map.json?user%5Fid=1053774&x=375&y=375×tamp=1310616808&%5Fsession%5Fid=5b2070a46a083a33e053d60dbc2d062e&dragon%5Fheart=f35f476facab91f0e901eaf2209a0c8a9b9bedcc&version=3
ANSWER
Finally back to this and found that the referrer was the problem. The server was expecting to see no referrer in the request header. When it did the request was blocked. That behaviour probably was not consistent across all servers at the time but it is now. Removing the referrer from the request header and leaving everything else the same now works.
So you’re trying to use your favorite WordPress plugin but an ugly cURL error 28 is being displayed in your screen or error log… Something like
cURL error 28: Connection timed out after X milliseconds
or
cURL error 28: Operation timed out after X milliseconds with 0 out of 0 bytes received
What’s going on? If you search in Google you will find that in fact it’s a very common issue and it’s not tied to any plugin or WordPress itself, it’s something directly related with a server component, the cURL library, so it can affect to any web software using cURL.
In this article I’m going to explain you a few things that hopefully will help you to understand what’s the issue and things that you may check in order to fix it.
But what the hell is cURL?
When talking about WordPress, cURL is a PHP library that helps WordPress to communicate with other sites. Being a PHP library means that if you’re using an obsolete PHP version (anything older than PHP 7.0) you’re for sure also using an obsolete cURL version. So the first thing you need to do if you’re having issues with cURL is to upgrade your PHP version to at least 7.0.x or the latest PHP 7.x stable release.
Note that on some server setups (e.g. cheap shared hosting) selecting a newer PHP version to run your site doesn’t necessarily means that you’re going to use a recent cURL version.
To be clear, I would recommend you to ensure that your site meet actual requirements for secure connections. Your server must be able to perform connections using SHA-2 and TLS 1.2, as this is required for third-party services as PayPal, Stripe, Authorize.net and many others that are using the HTTPS protocol to ensure privacy in connections to their services. So make a favor to yourself and ensure that your site is hosted on a server with at least cURL version 7.34.0 or higher, a recent build of OpenSSL/1.0.1 or higher (another library) and also a recent version of PHP, currently 7.1 is the recommended choice.
I have an up to date PHP, cURL and OpenSSL but still getting cURL error 28
The cURL error 28 literally means that your site tried to perform a request using the cURL library but the specified timeout period was reached before getting a successful result for the request.
In general terms, this could be caused by a very short timeout time specified for the cURL request or because the server is not able to establish the connection or complete the operation before reaching the timeout for whatever reason.
Things to check in the server
If you already checked that you’re running the recent versions mentioned above. Other common causes at server side for this error are:
- Issues with the DNS resolving (your server is not able to resolve the IP for the third-party domain or at least not in time).
- Firewalls or security modules (e.g. mod_security ) blocking the outgoing request.
- Your host is not able to “talk” with the third-party server due to unavailable required protocols. This can occur if the server has a recent cURL/OpenSSL but it’s not correctly configured to use TLS 1.2 as SSL procotol.
- Network issues (something at network level prevents your server to reach the third-party server).
- Your server is blocking connections to your own site. Some hosts don’t allow sites hosted in their servers to connect their self using cURL. It’s very common for a WordPress site to perform connections to itself (e.g. AJAX requests) and I can’t see any valid reason to apply this blocking in a server. But for some reason there are many hosts doing this (specially in cheap hosting plans). So you will want to contact with your host support about this and request to remove that limitation if it’s set in the server.
- Something in the site setup disabled certificate validation and the host doesn’t allow requests without certification validation.
These are only a few things, the most common causes, your server admin should be able to check anything that could cause cURL to fail at server side.
Also checking the PHP and web server (Apache, nginx, etc) error logs can probably give you additional information about what’s going on. If you don’t have access to these logs ask for them to your server admin.
Things to check in WordPress when cURL fails
First thing I would recommend you to do is to enforce the certificate validation by using the https_local_ssl_verify filter in your theme’s functions.php file or a custom functionality plugin:
If the above doesn’t help try setting a higher timeout value. By default WordPress set the timeout value in wp-includes/class-wp-http-curl.php to 5 seconds and the same value is also set in wp-includes/class-http.php that is a newer class for making HTTP requests that can use also cURL if it’s present in the server.
You may think that 5 seconds is a very short time, but in terms of doing an HTTP request 5 seconds should be enough in most cases.
Anyway this value can be overridden using a few WordPress core filers: http_api_curl, http_request_timeout or http_request_args. Below you can find an example of how to set the timeout value to 30 seconds using all these filters.
To troubleshoot the issue you can temporarily set the timeout value to a crazy high value like 120 seconds just to see if the HTTP request is completed at some point… Bear in mind with this value in the timeout you will need to wait up to 2 minutes to see the result.
Note that the correct value for the timeout will be directly related to the amount of data that you’re sending in the cURL request. For example, if you’re sending a small single file, that will require a low timeout value, if you’re sending a very big file or multiple files, you will need to set a higher timeout value.
You can also use the Core Control plugin to monitor all outgoing connections done by WordPress providing you a lot of useful information like the time taken for the request and even the response headers and body. It’s a very handy companion for the troubleshooting!
Another WordPress plugin that can help you is TLS 1.2 Compatibility Test, with this plugin you can test your server compatibility for TLS 1.2 directly in your WP dashboard.
Finally, don’t forget to check this post comments, some users posted their own solution for specific scenarios that maybe could help in your case too.
The third-party side of things
If your site is trying to connect to a third-party server, you need to keep in mind also that you don’t have any control over the third-party server, and they could have also issues at their side or things (e.g. server busy or network issues) or they could be blocking your requests… So if all other fails you should start considering this also and try to contact with the third-party service for assistance.
And… That’s all Folks!
“The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.
The REST API request failed due to an error.
Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed)”
cURL error 28: Connection timed out, resulting in sluggish Page Speed Insights, is usually found to occur when you are transferring your site from one cPanel Account to another or to a new server.
However, no matter how you got that error, it’s important to FIX it and close all doors for it to enter again.
Are you experiencing a delay in site loading? Well, first you need to check the site for Curl Error 28. Solve curl Error 28, Request Timeout Error – The Error that took 10 days to Solve after experimenting 100s of different methods to resolve my site back. Want to know how did I solve it?
While on most of the tech sites and forums you will find that this is a server error, it might be possible that your hosting provider cannot help you with this issue and you end up hearing that something is wrong with your site at your end.
If you are suddenly experiencing website page speed issues and from 10 seconds load time is increased to 40-50 seconds, this must be due to cURL error 28.
Here are a few steps to check error cURL 28, request timeout from your website backend: –
- Go to your WordPress Website back-end with the link – Domain Name/wp-admin.
- Click on Settings & then Tools, there you will find, Site health tab
- This Site Health tab tells you the current Website issues going in your site whether they are related to Plugins, theme updates, old PHP versions, latest WordPress updates, or any other website loading issue.
There are several reasons predicted to cause cURL error 28 on your websites such as Server error, some DNS issues, WordPress Connectivity issue with the domain, old PHP versions, or limited memory allocated to the site.
Considering, you have beginner developer knowledge, here’s a list of possible errors that can help you fix this error on your own: –
- Check your website PHP version, upgrade if low.
- Check your WordPress & it’s plugins update – Keep everything updated. Check your domain, IP, and DNS connections. Site – “What’s my DNS” is helpful – https://www.whatsmydns.net/.
- Go to PHP INI manager and open error display setting on the Particular PHP version you site is running, to help you know where the exact issue is pulling up .
- Try “Troubleshooting Plugin” of WordPress and deactivate all plugins through it. Then reactivate your plugins one by one to check which is causing the issue. (I would recommend to completely delete that plugin and then install it, a fresh).
- Check the error log in cPanel to check which code line is causing the error in your website.
- Error logs also come up in File manager (outside public_html).
- If you are technically sound (highly recommended), then check your Server Security Configuration in mod_security, in WHM Panel. This is helpful if all your websites are showing the same error. However, if only 1 or 2 sites are showing this error, then the issue lies somewhere else.
- Increase PHP limits (check PHP INI for that) or Add a file “php.ini” in your Website’s root directory with the following code.
- Contact your administrator or Hosting Provider.
- If none of the above works out, remember the one option left is, you need to completely set up your website again.
(Just take your existing site backup and Read the next blog to know how to do retrieve your existing site in just 1 hour)
I’m in Ubuntu 16.04, running R
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 2.3
year 2015
month 12
day 10
svn rev 69752
language R
version.string R version 3.2.3 (2015-12-10)
nickname Wooden Christmas-Tree
All packages and dependencies are up to date (includes devtools and Rcurl, curl, httr).
When trying to use install_github to install any package, I get the following:
Error in curl::curl_fetch_memory(url, handle = handle) :
Timeout was reached
traceback()
12: .Call(R_curl_fetch_disk, url, handle, path, «wb», nonblocking)
11: curl::curl_fetch_disk(url, x$path, handle = handle)
10: request_fetch.write_disk(req$output, req$url, handle)
9: request_fetch(req$output, req$url, handle)
8: request_perform(req, hu$handle$handle)
7: httr::GET(url, path = path, httr::write_disk(path = tmp))
6: remote_package_name.github_remote(remote)
5: remote_package_name(remote)
4: FUN(X[[i]], …)
3: vapply(remotes, install_remote, …, FUN.VALUE = logical(1))
2: install_remotes(remotes, quiet = quiet, …)
1: install_github(«StatsWithR/statsr»)