Ошибка rss wp http error curl error 28 connection timed out after 10000 milliseconds

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.

Fixing the cURL error 28: Connection timed out issue in WordPress

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 it.

The cURL library plays an important 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 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 will see a critical issue in the Site Health report with the title ‘The REST API encountered an error’.

cURL error 28 shown in WordPress site health report

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 Can Cause cURL to Time Out?

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 because it considers it to be 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 that stops certain WordPress processes from running properly.

That being said, let’s take a look at how to troubleshoot and solve a curl error 28: Connection timed out issue in WordPress.

1. Temporarily Disable the WordPress Firewall

If you are using a WordPress firewall or a security plugin, then go ahead and temporarily deactivate it.

Deactivate WordPress firewall plugin

After that, you just need to visit the WordPress Site Health report page to see if your issue has been resolved.

If it has, then simply 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 the 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 they may cause the cURL error in your Site Health report.

The easiest way to figure out if your WordPress plugins are causing issues is by deactivating all of them. Simply go to the Plugins » Installed Plugins page and select all plugins.

Deactivate all WordPress plugins

After that, click on the Bulk Actions drop-down menu 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 problem, then you can start activating your plugins and check if one of them causes the error message to reappear.

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 on the Tools » Site Health page.

System information report under site health

Simply switch to the ‘Info’ tab and expand the ‘Server’ section. From here, you can get information about software installed on your WordPress hosting server.

Check PHP, cURL, and OpenSSL versions

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 will need to contact your WordPress hosting company and ask them to update your WordPress to the latest software versions 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 cause your web server to block insecure cURL requests.

Similarly, if your WordPress site doesn’t use HTTPS/SS, 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)’

cURL error 7 in WordPress

To fix this, you can ask your hosting provider to re-install the 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 Your 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 time out.

Another scenario could be slower connectivity or networking issues with your hosting server.

If the problem is still there, contact the hosting support team with a support request containing the error details. Then, their technical staff can troubleshoot and apply a fix to solve it.

If your host isn’t very helpful, it might be time to switch to a managed WordPress hosting provider like SiteGround. With SiteGround, you will have access to 24/7 expert technical support, along with blazing-fast servers and premium WordPress security.

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.

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.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience building WordPress websites. We have been creating WordPress tutorials since 2009, and WPBeginner has become the largest free WordPress resource site in the industry.

ochibka-v-wordpress-001Приветствуем вас! Вы видите ошибку 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 или плагин безопасности, временно отключите его.

ochibka-v-wordpress-01

После этого вам нужно посетить страницу отчета о работоспособности сайта WordPress, чтобы узнать, решена ли ваша проблема.

Если да, то вам нужно проверить журналы брандмауэра WordPress, чтобы узнать, какие запросы API были заблокированы. Это либо определит источник проблемы, либо вы можете настроить параметры брандмауэра, чтобы не блокировать законные запросы API.

2. Отключите все плагины WordPress

Плагины WordPress создают собственные запросы API для отправки и получения данных. Если эти вызовы слишком часты или для выполнения требуется слишком много времени, это может вызвать ошибку cURL в отчете о работоспособности вашего сайта.

Самый простой способ выяснить это — отключить все плагины WordPress. Просто перейдите на страницу «Плагины»-«Установленные» и выберите все плагины.

ochibka-v-wordpress-02

После этого щелкните раскрывающееся меню «Массовые действия», чтобы выбрать «Деактивировать», а затем нажмите кнопку «Применить».

Теперь вы можете посетить отчет о работоспособности сайта, чтобы узнать, исчезла ли проблема. Если это устранило проблему, вы можете активировать свои плагины один за другим, пока проблема не появится снова.

Это поможет вам найти плагин, который может вызывать проблему.

3. Убедитесь, что ваш хостинг-сервер использует новейшее программное обеспечение

Следующий шаг — убедиться, что ваш хостинг-сервер WordPress использует последние версии PHP, библиотеки cURL и OpenSSL.

Вы можете проверить это, просмотрев вкладку системной информации на странице «Инструменты»-«Здоровье сайта».

ochibka-v-wordpress-03

Просто перейдите на вкладку «Информация» и разверните раздел «Сервер». Отсюда вы можете получить информацию о программном обеспечении, установленном на вашем хостинг-сервере WordPress.

ochibka-v-wordpress-04

В идеале ваш сервер должен использовать 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.

Другой сценарий может заключаться в более медленном подключении или сетевых проблемах с вашим хост-сервером.

Просто отправьте им запрос в службу поддержки с подробными сведениями об ошибке, и их технический персонал сможет устранить неполадки и применить исправление для ее решения. Ну что, у нас на этом все. Всем пока!

С уважением Вячеслав и Валерия!

Понравился материал? Поделитесь с друзьями!

Интересное на блоге

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.

Fixing the cURL error 28: Connection timed out issue in WordPress

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’.

cURL error 28 shown in WordPress site health report

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.

Deactivate WordPress firewall plugin

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.

Deactivate all WordPress 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.

System information report under site health

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.

Check PHP, cURL, and OpenSSL versions

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)

cURL error 7 in WordPress

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.

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.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. We have been creating WordPress tutorials since 2009, and WPBeginner has become the largest free WordPress resource site in the industry.

The digital world is currently experiencing incredible growth and change. Competition leads to the search and development of new ways to capture the market, as well as tools that could do this as efficiently and quickly as possible.

Due to the need to be the most competitive in their niche, digital applications are increasingly being improved and updated providing their users with a wider range of options and capabilities. Which in turn leads to the fact that applications require regular updates and corrections to maintain maximum efficiency. However, with this approach, there is one drawback – a fairly frequent update often leads to appearing more compatibility errors.

In our example, such kind of errors was caused by the new version of WordPress 5.2 and the introduction of a new tool called Site Health.

You may have already seen similar errors when using the new Site Health tool. Their description on the Status page of Site Health tool is as follows

The REST API encountered an error
The REST API request failed due to an error.
Error: cURL error 28: Operation timed out after 10000 milliseconds with 0 bytes received (http_request_failed)

Your site could not complete a loopback request
The loopback request to your site failed, this means features relying on them are not currently working as expected.
Error: cURL error 28: Operation timed out after 10000 milliseconds with 0 bytes received (http_request_failed)

What causes the issue

REST API and loopback requests issues due to cURL error 28 is happening due to the fact that PHP script in curl waits for the session to free itself from the first script that calls the API.

In most cases, the real reason of the above errors is the incorrect mechanism for using PHP sessions within plugins or themes when they are using the session_start () function.

For example, within some plugins or themes, you can find a similar to below piece of code that is responsible for a PHP session activation and may cause the above errors.

function custom_session_init()
{
    if ( !session_id() ) {
        @session_start();
    }
}

Manually check for plugins and theme compatibility

One of the best way to find the source of the issue is to deactivate all plugins and switch to a default WordPress theme like Twenty Twenty or similar. If issues disappear then you need to activate your plugins one by one, until you will see the error on Status tab of WordPress Site Health tool. Then you need to check your custom theme by activating it and disabling all plugins.

Step by step guide:

  1. Create your WordPress site backup. You can do this manually or by using a backup plugin such as BackupBuddy
  2. Log in to your WordPress site
  3. Go to Appearance -> Themes
  4. Install and activate the latest default WordPress theme, for example, Twenty Twenty. Be careful, in some cases(custom themes), the settings or widgets may be reset.
  5. Go to Plugins -> Installed plugins
  6. Choose all plugins and deactivate them
  7. Activate one plugin at a time and check the Status page of Site Health tool
  8. Repeat step 7 until you will find the issue
  9. If you do not find the issue during plugin check than keep all plugins deactivated. Switch to your custom theme and check whether your theme causes the issue.

How to fix REST API and Loopback request issues due to cURL error 28

1. WordPress Native PHP Sessions Plugin

According to the statement of the WordPress team – WordPress does not use sessions in any way at all. All user states controlled with cookies.

It also means you should avoid using a session within your code for WordPress. However, if your site or plugin requires using PHP sessions for some specific tasks and you can’t avoid using sessions, you can try WordPress Native PHP Sessions Plugin.

The plugin will not solve all session based issues, but in the particular case it may help. If after installing this plugin errors will still be present, you need to consider other solutions to this problem using one of the tips below.

2. Use session_write_close()

PHP sessions created with session_start() function may cause issues with REST API and loopback requests due to cURL error 28. According to recommendations of WordPress core team active PHP session should be closed before making any HTTP requests

In order to close an active session, you can to use one of the two options below

1) If you need to make changes to the session, then after entering the data, close the session from writing:

session_write_close(); 

2) If you are sure that you do not need to make changes to the session data, use the read_and_close option when starting the session:

session_start([
    'read_and_close' => true,
]);

3. Use cookie

A cookie is a small portion of data which web server sends to the user’s browser. After receiving the piece data, the browser saves it locally on computer. Next time when you are requesting another page from the same server, browser sends the cookie back to the server inside Cookie HTTP header.

Usually, cookie used for recording and analyzing user behavior, storing using preferences and settings, shopping carts, logins, and any other data that server should remember.

How to create, update and delete cookie

In order to set cookies we need to use the PHP function setcookie(options) which can accept various options, such as:

  • Name – name of the cookie
  • Value – a piece of data which you want to store
  • Expires – time during which cookies exist
  • Path – the path on the server in which the cookie will be available on
  • Domain – the (sub)domain that the cookie is available to
  • Secure – Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client
  • httponly – When TRUE the cookie will be made accessible only through the HTTP protocol. This means that the cookie won’t be accessible by scripting languages, such as JavaScript
setcookie(name, value, expire, path, domain, secure, httponly);

Create

To create cookies, you just need to add a few simple lines of PHP code to function.php file of you active theme or inside your custom plugin files. In the example below, you can see how to create a ‘map_data cookie’ cookie with 30 days lifetime which containing value ‘John’

$cookie_name = 'mwp_data_cookie'; // set the name of the cookie
$cookie_value = 'John'; // set the value of the cookie
$cookie_expire = time() + 60*60*24*30; // set cookie lifetime for 30 days
setcookie($cookie_name, $cookie_value, $cookie_expire); //  30 days

Next piece of code will show you how to receive cookie value:

// Now you can receive cookie value
if(!isset($_COOKIE[$cookie_name])) {
        print 'Cookie "' . $cookie_name . '" does not exist';
} else {
        print 'Cookie "' . $cookie_name . '" value is:'.$_COOKIE[$cookie_name];
}

Update

In order to update cookie you need to overwrite it with a new one by using the same name.

$cookie_name = 'mwp_data_cookie'; // set the name of the cookie
$cookie_value = 'John Doe'; // set updated value of the cookie
$cookie_expire = time() + 60*60*24*30; // set cookie lifetime for 30 days
setcookie($cookie_name, $cookie_value, $cookie_expire); //  30 

Delete

If you want to delete the cookie you need to set date in the past, to trigger the removal process.

$cookie_name = 'mwp_data_cookie';
setcookie($cookie_name, '', time() - 3600); // set expiration date 1 hour ago

If you don’t know how to program or don’t want to do it on your own, then you better find a good developer and assign this task to him. Or you can just contact us

See Also: WordPress site health guide: How to get 100% check score?

Mik Foxi

На сайте с 02.03.2011

Offline

1029

Российские хостеры сейчас находятся в кризисной ситуации, экономят на всем, оверселят, потому и тормоза и не качественная работа серверов. И не нужно придумывать фантастических теорий.

Антибот, антиспам, веб файрвол, защита от накрутки поведенческих: https://antibot.cloud/ru.html + партнерка, до 40$ с продажи.

alaev

На сайте с 18.11.2010

Offline

610

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

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

  • 2021.01.05
  • About the Editorial Staff
  • www.wpbeginner.com

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…

Создание и продвижение сайтов — https://alaev.net , аудиты сайтов, контекстная реклама

PA

На сайте с 15.02.2018

Offline

83

Все… Началось…

B

На сайте с 27.05.2018

Offline

86

dnd20 :

Вот еще человек жалуется: 

У него совсем другое, решение его дочитай до конца

M

На сайте с 13.12.2017

Offline

46

dnd20 :

Заметил, что стала появляться ошибка вида 

cURL error 28: Connection timeout after 10000 ms

при обращении к сервисам WordPress.Org

Посмотрел сообщения вне РФ, там жалоб таких нет. Но у меня работает через раз и постоянно появляется cURL error 28: Connection timeout after 10000 ms

Разумеется, дело не в РФ. Не надо плодить теории заговора на пустом месте. А то и до Гейтса с его вакцинными чипами дойдем.

Сталкивался с такой ошибкой и одновременно массой других, включая cURL error 6, плюс тормозами в админке WP.
Проблема была в отвалившемся DNS на стороне хостера, крупного и с хорошей репутацией.
Напишите в службу поддержки, пусть поменяют DNS, например, на стабильные гугловские.

1

Ilya74

На сайте с 12.06.2008

Offline

299

Они случайно не на github размещают это api? Всё чаще и чаще стал замечать недоступность api.github.com, codeload.github.com и прочих связанных сервисов с серверов, размещённых в РФ. 

И да, зависимость от DNS есть. В частности, замечаю такое при использовании в качестве DNS не Google DNS (8.8.4.4 / 8.8.8.8), а DNS от Level 3 (4.4.2.2 / 4.4.4.4). Тут не лишним будет спросить хостера, что он использует.

M

На сайте с 13.12.2017

Offline

46

Ilya74 #:

Они случайно не на github размещают это api? Всё чаще и чаще стал замечать недоступность api.github.com, codeload.github.com и прочих связанных сервисов с серверов, размещённых в РФ. 

И да, зависимость от DNS есть. В частности, замечаю такое при использовании в качестве DNS не Google DNS (8.8.4.4 / 8.8.8.8), а DNS от Level 3 (4.4.2.2 / 4.4.4.4). Тут не лишним будет спросить хостера, что он использует.

Вроде бы нет. У них свои. Стучится в public-api.wordpress.com и pixel.wp.com, которые хостятся на родном automattic.com.

Mik Foxi

На сайте с 02.03.2011

Offline

1029

Ilya74 #:
Они случайно не на github размещают это api? Всё чаще и чаще стал замечать недоступность api.github.com, codeload.github.com и прочих связанных сервисов с серверов, размещённых в РФ. 

сталкивался и не раз за последние месяцы с тем, что с РФ шаред хостингов не доступны сайты за cloudflare, на бегете, мастерхосте и еще каких-то, некоторые хостеры выдвигали теорию что это потому что ркн забанил доступ, но самостоятельное выяснение привело к тому что хостеровские днс тормозят (для исходящего днс запроса) или сами сервера не осиливают сделать курл запрос за адекватное время потому что тупо сервер нагружен слишком сильно. 

D2

На сайте с 26.10.2020

Offline

19

Mik Foxi #:

сталкивался и не раз за последние месяцы с тем, что с РФ шаред хостингов не доступны сайты за cloudflare, на бегете, мастерхосте и еще каких-то, некоторые хостеры выдвигали теорию что это потому что ркн забанил доступ, но самостоятельное выяснение привело к тому что хостеровские днс тормозят (для исходящего днс запроса) или сами сервера не осиливают сделать курл запрос за адекватное время потому что тупо сервер нагружен слишком сильно. 

Да , похоже так оно и есть. Придется обновляться ночью , так как связано с нагрузкой.

Бегет и Фоззи пишут, что у них все ОК. Оверселлят походу

Так и придется на ВПС уходить, но не хочется, ибо админить никакого желания нет

Бахин

На сайте с 26.05.2017

Offline

64

Использую хостинг Fozzy, но, как понял, это от хостинга не зависит

зависит, я на сервере один раз сам случайно блокнул и все тоже самое было, но пару раз не блокал, тогда просто в hosts на сервере вписывал их ip и домен api.wordpress.com — заработало

Although WordPress is a reliable Content Management System (CMS), it’s not infallible, especially when you’re making high-level customizations to the software. Therefore, you might sometimes run into WordPress errors. One of these is “cURL error 28: connection timed out.”

The good news is there are a few ways to fix the cURL error 28 in WordPress. These methods range from simple fixes, such as deactivating your plugins, to more advanced procedures, like updating your SSL settings.

In this post, we’ll explore the cURL error 28 and its causes. Then, we’ll explain how to solve this issue in WordPress using six different methods. Let’s get started!

What Is the cURL Error 28 in WordPress?

Client URL, also known as cURL, is a command line tool. Simply speaking, it transfers data to and from a server through URLs.

In the context of WordPress, the CMS uses cURL within the REST API. cURL handles API requests, enabling your website to access and transmit data to its server and corresponding database.

Here’s what that process looks like:

The REST API

The REST API

This data transfer process takes a certain amount of time. However, if it takes too long, it can time out and display the “cURL error 28: connection timed out” message.

You will typically see this message in the Site Health section of your WordPress dashboard. The error will have the headline “The REST API encountered an error”. Clicking on this heading will expand the message, where you might see the following:

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

Alternatively, you may see this related error message:

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

Although WordPress is reliable, it’s not infallible- which is where troubleshooting guides like this come into play! 🚀Click to Tweet

What Causes the “cURL Error 28: Connection Timed Out” Error?

There are a few reasons you might be seeing the cURL error 28. For example, your WordPress firewall might interpret a particular REST API request as suspicious. Then, it will prevent it from completing in an attempt to protect your website against malware or other security threats.

Alternatively, a faulty or poorly-configured DNS server may prevent WordPress from loading the HTTP requests correctly. The DNS server receives domain name requests and translates them into IP addresses, sending users to the correct websites. If this process doesn’t work properly, it can time out and throw the cURL error 28:

An image showing how a DNS server works

How a DNS server works

Furthermore, your hosting provider may have put a low timeout limit on your server. This configuration means WordPress doesn’t have the time it needs to transfer the data between your website and its database.

Finally, WordPress plugins can cause this error message. Third-party software may contain code or scripts that interfere with the cURL data transfer process.

How To Fix the cURL Error 28 in WordPress (6 Methods)

In this section, we’ll explain how to fix the cURL error 28 in WordPress. We recommend trying each method in turn until the error message disappears.

It’s also worth considering using a staging site for this process. Then, you can troubleshoot the problem without affecting your live site.

With a Kinsta hosting plan, you can upgrade to premium staging environments. Then you can use up to five different environments, easily accessible from your MyKinsta dashboard.

Once you’ve fixed the issue on your staging site, you can push the changes live to solve the problem on your live website. Let’s start by explaining how to temporarily disable your firewall.

1. Temporarily Disable Your WordPress Firewall

We briefly touched on the idea of a WordPress firewall before. Essentially, this WordPress security mechanism filters suspicious traffic and prevents it from reaching your website. Sometimes, it might also be incorrectly blocking a legitimate REST API request and causing “cURL error 28: connection timed out.”

To verify if the firewall is causing the error, you’ll want to disable it temporarily. This process will differ slightly depending on your chosen software. We’ll show you how to do this with the Wordfence plugin.

In your WordPress dashboard, head to Wordfence > Firewall. Then scroll down to Web Application Firewall Status:

How to disable the Wordfence firewall in WordPress

Disable the Wordfence firewall in WordPress

Select Disabled from the dropdown menu and click on Save Changes. Next, we recommend checking to see if your website still shows the cURL error 28.

After that, re-enable your firewall after a few minutes and see if it causes the error again. If so, consider choosing a different firewall plugin or contacting the plugin developers for further assistance.

2. Deactivate Your WordPress Plugins

Any of the WordPress plugins on your website could be causing the connection timeout error. Since you won’t know until you try them, this approach is all about trial and error. You’ll need to deactivate all your plugins and reinstall them one by one.

If you have access to your WordPress dashboard, this process is straightforward. Simply navigate to Plugins > Installed Plugins and check the top left box to select all of them. Then, click on Deactivate in the Bulk actions dropdown menu and hit Apply:

Bulk deactivating WordPress plugins

Deactivating WordPress plugins in bulk

Alternatively, if the cURL error 28 is blocking access to your WordPress dashboard, you’ll need to manually disable your WordPress plugins. To do this, connect to your site with an SFTP client such as FileZilla.

Then, locate your wp-content folder. It should have a sub-folder called plugins:

A screenshot showing how to disable WordPress plugins manually

Disabling a WordPress plugin manually

Rename this folder to “plugins-old”. This will deactivate all of the plugins on your website. Next, you can log in to your WordPress dashboard and reactivate each tool until you find the one causing the issue.

Once you’ve found the problem plugin, you might consider downgrading WordPress until you can find a permanent solution. Otherwise, you can uninstall the plugin and look for alternative software for your site.

3. Explore Your SSL Settings

A Secure Sockets Layer (SSL) certificate is an essential security feature. When working correctly, it provides an encrypted connection between visitor browsers and your WordPress website.

However, an improperly installed or configured SSL certificate can cause issues on your website and block what it considers “insecure” requests. Therefore, it might trigger the cURL error 28 or other SSL connection errors such as cURL error 7.

First, you can verify if your SSL certificate is installed correctly by running an SSL check with the Qualys SSL Labs test. Just enter your hostname into the box and click on Submit. You’ll then receive a report highlighting any issues:

Running an SSL check with Qualys SSL Labs

Qualys SSL Labs

As you can see, our Kinsta hosting plans come equipped with a Cloudflare SSL certificate, and the above report shows no issues.

However, if you identify a problem with your SSL certificate, you can reinstall and reconfigure it, making sure you do so properly. To be sure, you can follow these instructions on how to correctly install an SSL certificate. After that, you can check to see if this has resolved the error.

4. Verify Your DNS Settings

As we briefly explained before, a poorly-configured DNS server can prevent WordPress from processing HTTP requests. This can throw the cURL error 28.

You’ll need to contact your hosting provider if the issue is with the DNS server itself. Your web host may be experiencing issues that prevent the server from processing requests before they time out.

Since you can’t control this process on your end, we recommend raising a support ticket with your host. This way, the support team can help you troubleshoot the issue and propagate the new DNS settings to put them into effect.

You can also verify DNS settings on your end. This method will be appropriate if you suspect that the issue is with your device (i.e., your computer).

You can adjust your DNS settings in Windows by pressing Windows + I. Then head to Network & internet and click on either Ethernet or Wi-Fi, depending on how your computer connects to the internet. Next, select the properties option for your connection:

A screenshot showing how to access the network settings on Windows

Access the network settings on Windows

Now open the settings for the DNS server assignment:

Opening the DNS server assignment settings

DNS server assignment settings

Select Manual from the dropdown menu and click on the slider next to IPv4:

Enabling manual DNS settings on Windows

Enabling manual DNS settings on Windows.

In the Preferred DNS box, you can enter any of the following DNS addresses:

  • Cloudflare: 1.1.1.1
  • Google Public DNS: 8.8.8.8
  • OpenDNS: 208.67.222.222

Then add one of the others to the Alternate DNS box. Remember to hit Save when you’re done. You may need to restart your computer before the changes take effect.

5. Check Your Server Limits and cURL Version

Outdated software or limited server resources may cause cURL requests to time out. For example, outdated PHP, cURL library, or OpenSSL could trigger the cURL error 28.

To check on this, head to Tools > Site Health > Info > Server in your WordPress dashboard:

How to check your server settings in WordPress

Checking server settings in WordPress

You can read our article on the ideal WordPress PHP and server requirements to see if the values match up.

If they don’t, you can follow our guide on how to update your PHP version. Additionally, you can contact your hosting provider for further assistance or request to update the server configuration.

It’s also important to have some awareness of your website’s PHP memory limit and PHP time limit. This is because WordPress can time out when processing REST API requests if these limits are too low. As a result, this could cause a “508 resource limit is reached” or cURL error.

Again, your hosting provider generally sets the maximum values for these limits. Therefore, you’ll need to contact them if you’d like to increase the limits.

6. Contact Your Hosting Provider for Assistance

Finally, you may have tried all the troubleshooting methods in this tutorial, but you still see “cURL error 28: connection timed out”. While this can be frustrating, you have one last option: going directly to your web host for help.

If you’ve chosen a reliable hosting provider, you should have access to different support channels, such as live chat or a ticketing system. For example, at Kinsta, we provide live messaging and speedy responses:

Kinsta support website page

Kinsta Support

When you contact your hosting provider, make sure to give as much information as you can about the error you’re seeing. Then your host will be better equipped to troubleshoot the issue.

Whether you want a simple fix, such as deactivating your plugins, or a more advanced procedure, like updating your SSL, this guide has you covered 🛠Click to Tweet

Summary

“cURL error 28: connection timed out” can be frustrating to see when you’re working on your WordPress website. Fortunately, there are a few ways to troubleshoot this issue.

To fix the cURL error 28, we recommend starting with easy solutions like temporarily disabling your WordPress firewall and deactivating your plugins. Then, you can move on to checking your SSL and DNS settings, along with your server resource limits. Finally, if all else fails, it might be time to contact your web host for assistance.

Are you looking for a hosting provider to help you with any technical issues? Our Kinsta managed WordPress hosting packages come with 24/7 premium support. Plus, you’ll have access to our Kinsta APM tool for monitoring your website and improving its performance. Check out our plans today!


Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:

  • Easy setup and management in the MyKinsta dashboard
  • 24/7 expert support
  • The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
  • An enterprise-level Cloudflare integration for speed and security
  • Global audience reach with up to 35 data centers and 275 PoPs worldwide

Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.

“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: –

  1. Go to your WordPress Website back-end with the link – Domain Name/wp-admin.
  2. Click on Settings & then Tools, there you will find, Site health tab
  3. 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: –

  1. Check your website PHP version, upgrade if low.
  2. 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/.
  3. 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 .
  4. 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).
  5. Check the error log in cPanel to check which code line is causing the error in your website.
  6. Error logs also come up in File manager (outside public_html).
  7. 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.
  8. Increase PHP limits (check PHP INI for that) or Add a file “php.ini” in your Website’s root directory with the following code.
  9. Contact your administrator or Hosting Provider.
  10. 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)

Просмотр 15 ответов — с 1 по 15 (всего 16)

  • Хостер говорит что ничего не блокирует…

    @portass Этот хостер случайно не Бегет?

    • Ответ изменён 1 месяц назад пользователем medmall.

    @igor-san если так, то почему ошибка иногда пропадает? То блокирует, а то вдруг на время разблокирует?

    @medmall да,бегает, я так понял у многих проблемы. Плагины не обновляются,админка дико тупит…

    @portass да, есть такая проблема: и админка тупит, и плагины не обновляются, невозможно установить новый из адмминки, не обновляются темы и переводы; «здоровье сайта» периодически показывает критическую проблему «Ошибка Ваш сайт не смог подключиться к WordPress.org по 198.143.164.251, и вернул ошибку: cURL error 28: Connection timed out after 10001 milliseconds»! Проблема, кстати, плавающая — прошедшим вечером и ночью после кучи попыток удалось обновиться.

    @medmall А что с бегет не так уже?

    @fletot21 в первом посте и моём посте выше как раз и написано, что сейчас с Бегетом не так.

    @medmall честно говоря я поменял много хостингов, Бегет хоть и дороже но мне понравился качеством услуг и адекватной техподдержкой. Но походу наступил момент когда нужно искать нового хостера.

    Но походу наступил момент когда нужно искать нового хостера.

    я бы все-таки подождал числа 20го, потом бы решал.

    portass это он сейчас стал дороже, буквально год назад было ещё норм. Косячили они всегда, ТП действительно адекватная, пусть и подтупливает иногда. А хорошо там, где нас нет.

    Я в соседней теме отписался, что проблема с обновлениями вроде как исчезла. Недели хватило на решение проблемы — учитывая календарь — норм;)

    @medmall Да, работает, молчу бо боюсь сглазить))). А что же все таки это было? Чисто ради интереса

    Модератор
    Yui

    (@fierevere)

    ゆい

    Рад интереса?
    Из за избытка трафика определяемого как вредоносный, IP Бегета периодически блокировались на SingleHop (это Датацентр, который хостит WordPress.org, но не является нашим).

    Со стороны Бегет требовалось разобраться с вредоносным трафиком и/или пообщаться с сетевиками SingleHop.

    @fierevere Как я понял, проблему бегет так и не решил?

  • Просмотр 15 ответов — с 1 по 15 (всего 16)

    ochibka-v-wordpress-001Приветствуем вас! Вы видите ошибку 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 или плагин безопасности, временно отключите его.

    ochibka-v-wordpress-01

    После этого вам нужно посетить страницу отчета о работоспособности сайта WordPress, чтобы узнать, решена ли ваша проблема.

    Если да, то вам нужно проверить журналы брандмауэра WordPress, чтобы узнать, какие запросы API были заблокированы. Это либо определит источник проблемы, либо вы можете настроить параметры брандмауэра, чтобы не блокировать законные запросы API.

    2. Отключите все плагины WordPress

    Плагины WordPress создают собственные запросы API для отправки и получения данных. Если эти вызовы слишком часты или для выполнения требуется слишком много времени, это может вызвать ошибку cURL в отчете о работоспособности вашего сайта.

    Самый простой способ выяснить это — отключить все плагины WordPress. Просто перейдите на страницу «Плагины»-«Установленные» и выберите все плагины.

    ochibka-v-wordpress-02

    После этого щелкните раскрывающееся меню «Массовые действия», чтобы выбрать «Деактивировать», а затем нажмите кнопку «Применить».

    Теперь вы можете посетить отчет о работоспособности сайта, чтобы узнать, исчезла ли проблема. Если это устранило проблему, вы можете активировать свои плагины один за другим, пока проблема не появится снова.

    Это поможет вам найти плагин, который может вызывать проблему.

    3. Убедитесь, что ваш хостинг-сервер использует новейшее программное обеспечение

    Следующий шаг — убедиться, что ваш хостинг-сервер WordPress использует последние версии PHP, библиотеки cURL и OpenSSL.

    Вы можете проверить это, просмотрев вкладку системной информации на странице «Инструменты»-«Здоровье сайта».

    ochibka-v-wordpress-03

    Просто перейдите на вкладку «Информация» и разверните раздел «Сервер». Отсюда вы можете получить информацию о программном обеспечении, установленном на вашем хостинг-сервере WordPress.

    ochibka-v-wordpress-04

    В идеале ваш сервер должен использовать 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.

    Другой сценарий может заключаться в более медленном подключении или сетевых проблемах с вашим хост-сервером.

    Просто отправьте им запрос в службу поддержки с подробными сведениями об ошибке, и их технический персонал сможет устранить неполадки и применить исправление для ее решения. Ну что, у нас на этом все. Всем пока!

    С уважением Вячеслав и Валерия!

    Понравился материал? Поделитесь с друзьями!

    Интересное на блоге

    Mik Foxi

    На сайте с 02.03.2011

    Offline

    1049

    Российские хостеры сейчас находятся в кризисной ситуации, экономят на всем, оверселят, потому и тормоза и не качественная работа серверов. И не нужно придумывать фантастических теорий.

    Антибот, антиспам, веб файрвол, защита от накрутки поведенческих: https://antibot.cloud/ru.html + партнерка, до 40$ с продажи.

    alaev

    На сайте с 18.11.2010

    Offline

    630

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

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

    • 2021.01.05
    • About the Editorial Staff
    • www.wpbeginner.com

    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…

    Создание и продвижение сайтов — https://alaev.net , аудиты сайтов, контекстная реклама

    PA

    На сайте с 15.02.2018

    Offline

    86

    Все… Началось…

    B

    На сайте с 27.05.2018

    Offline

    95

    dnd20 :

    Вот еще человек жалуется: 

    У него совсем другое, решение его дочитай до конца

    M

    На сайте с 13.12.2017

    Offline

    51

    dnd20 :

    Заметил, что стала появляться ошибка вида 

    cURL error 28: Connection timeout after 10000 ms

    при обращении к сервисам WordPress.Org

    Посмотрел сообщения вне РФ, там жалоб таких нет. Но у меня работает через раз и постоянно появляется cURL error 28: Connection timeout after 10000 ms

    Разумеется, дело не в РФ. Не надо плодить теории заговора на пустом месте. А то и до Гейтса с его вакцинными чипами дойдем.

    Сталкивался с такой ошибкой и одновременно массой других, включая cURL error 6, плюс тормозами в админке WP.
    Проблема была в отвалившемся DNS на стороне хостера, крупного и с хорошей репутацией.
    Напишите в службу поддержки, пусть поменяют DNS, например, на стабильные гугловские.

    1

    Ilya74

    На сайте с 12.06.2008

    Offline

    316

    Они случайно не на github размещают это api? Всё чаще и чаще стал замечать недоступность api.github.com, codeload.github.com и прочих связанных сервисов с серверов, размещённых в РФ. 

    И да, зависимость от DNS есть. В частности, замечаю такое при использовании в качестве DNS не Google DNS (8.8.4.4 / 8.8.8.8), а DNS от Level 3 (4.4.2.2 / 4.4.4.4). Тут не лишним будет спросить хостера, что он использует.

    M

    На сайте с 13.12.2017

    Offline

    51

    Ilya74 #:

    Они случайно не на github размещают это api? Всё чаще и чаще стал замечать недоступность api.github.com, codeload.github.com и прочих связанных сервисов с серверов, размещённых в РФ. 

    И да, зависимость от DNS есть. В частности, замечаю такое при использовании в качестве DNS не Google DNS (8.8.4.4 / 8.8.8.8), а DNS от Level 3 (4.4.2.2 / 4.4.4.4). Тут не лишним будет спросить хостера, что он использует.

    Вроде бы нет. У них свои. Стучится в public-api.wordpress.com и pixel.wp.com, которые хостятся на родном automattic.com.

    Mik Foxi

    На сайте с 02.03.2011

    Offline

    1049

    Ilya74 #:
    Они случайно не на github размещают это api? Всё чаще и чаще стал замечать недоступность api.github.com, codeload.github.com и прочих связанных сервисов с серверов, размещённых в РФ. 

    сталкивался и не раз за последние месяцы с тем, что с РФ шаред хостингов не доступны сайты за cloudflare, на бегете, мастерхосте и еще каких-то, некоторые хостеры выдвигали теорию что это потому что ркн забанил доступ, но самостоятельное выяснение привело к тому что хостеровские днс тормозят (для исходящего днс запроса) или сами сервера не осиливают сделать курл запрос за адекватное время потому что тупо сервер нагружен слишком сильно. 

    D2

    На сайте с 26.10.2020

    Offline

    19

    Mik Foxi #:

    сталкивался и не раз за последние месяцы с тем, что с РФ шаред хостингов не доступны сайты за cloudflare, на бегете, мастерхосте и еще каких-то, некоторые хостеры выдвигали теорию что это потому что ркн забанил доступ, но самостоятельное выяснение привело к тому что хостеровские днс тормозят (для исходящего днс запроса) или сами сервера не осиливают сделать курл запрос за адекватное время потому что тупо сервер нагружен слишком сильно. 

    Да , похоже так оно и есть. Придется обновляться ночью , так как связано с нагрузкой.

    Бегет и Фоззи пишут, что у них все ОК. Оверселлят походу

    Так и придется на ВПС уходить, но не хочется, ибо админить никакого желания нет

    1

    Бахин

    На сайте с 26.05.2017

    Offline

    67

    Использую хостинг Fozzy, но, как понял, это от хостинга не зависит

    зависит, я на сервере один раз сам случайно блокнул и все тоже самое было, но пару раз не блокал, тогда просто в hosts на сервере вписывал их ip и домен api.wordpress.com — заработало

    The digital world is currently experiencing incredible growth and change. Competition leads to the search and development of new ways to capture the market, as well as tools that could do this as efficiently and quickly as possible.

    Due to the need to be the most competitive in their niche, digital applications are increasingly being improved and updated providing their users with a wider range of options and capabilities. Which in turn leads to the fact that applications require regular updates and corrections to maintain maximum efficiency. However, with this approach, there is one drawback – a fairly frequent update often leads to appearing more compatibility errors.

    In our example, such kind of errors was caused by the new version of WordPress 5.2 and the introduction of a new tool called Site Health.

    You may have already seen similar errors when using the new Site Health tool. Their description on the Status page of Site Health tool is as follows

    The REST API encountered an error
    The REST API request failed due to an error.
    Error: cURL error 28: Operation timed out after 10000 milliseconds with 0 bytes received (http_request_failed)

    Your site could not complete a loopback request
    The loopback request to your site failed, this means features relying on them are not currently working as expected.
    Error: cURL error 28: Operation timed out after 10000 milliseconds with 0 bytes received (http_request_failed)

    What causes the issue

    REST API and loopback requests issues due to cURL error 28 is happening due to the fact that PHP script in curl waits for the session to free itself from the first script that calls the API.

    In most cases, the real reason of the above errors is the incorrect mechanism for using PHP sessions within plugins or themes when they are using the session_start () function.

    For example, within some plugins or themes, you can find a similar to below piece of code that is responsible for a PHP session activation and may cause the above errors.

    function custom_session_init()
    {
        if ( !session_id() ) {
            @session_start();
        }
    }

    Manually check for plugins and theme compatibility

    One of the best way to find the source of the issue is to deactivate all plugins and switch to a default WordPress theme like Twenty Twenty or similar. If issues disappear then you need to activate your plugins one by one, until you will see the error on Status tab of WordPress Site Health tool. Then you need to check your custom theme by activating it and disabling all plugins.

    Step by step guide:

    1. Create your WordPress site backup. You can do this manually or by using a backup plugin such as BackupBuddy
    2. Log in to your WordPress site
    3. Go to Appearance -> Themes
    4. Install and activate the latest default WordPress theme, for example, Twenty Twenty. Be careful, in some cases(custom themes), the settings or widgets may be reset.
    5. Go to Plugins -> Installed plugins
    6. Choose all plugins and deactivate them
    7. Activate one plugin at a time and check the Status page of Site Health tool
    8. Repeat step 7 until you will find the issue
    9. If you do not find the issue during plugin check than keep all plugins deactivated. Switch to your custom theme and check whether your theme causes the issue.

    How to fix REST API and Loopback request issues due to cURL error 28

    1. WordPress Native PHP Sessions Plugin

    According to the statement of the WordPress team – WordPress does not use sessions in any way at all. All user states controlled with cookies.

    It also means you should avoid using a session within your code for WordPress. However, if your site or plugin requires using PHP sessions for some specific tasks and you can’t avoid using sessions, you can try WordPress Native PHP Sessions Plugin.

    The plugin will not solve all session based issues, but in the particular case it may help. If after installing this plugin errors will still be present, you need to consider other solutions to this problem using one of the tips below.

    2. Use session_write_close()

    PHP sessions created with session_start() function may cause issues with REST API and loopback requests due to cURL error 28. According to recommendations of WordPress core team active PHP session should be closed before making any HTTP requests

    In order to close an active session, you can to use one of the two options below

    1) If you need to make changes to the session, then after entering the data, close the session from writing:

    session_write_close(); 

    2) If you are sure that you do not need to make changes to the session data, use the read_and_close option when starting the session:

    session_start([
        'read_and_close' => true,
    ]);

    3. Use cookie

    A cookie is a small portion of data which web server sends to the user’s browser. After receiving the piece data, the browser saves it locally on computer. Next time when you are requesting another page from the same server, browser sends the cookie back to the server inside Cookie HTTP header.

    Usually, cookie used for recording and analyzing user behavior, storing using preferences and settings, shopping carts, logins, and any other data that server should remember.

    How to create, update and delete cookie

    In order to set cookies we need to use the PHP function setcookie(options) which can accept various options, such as:

    • Name – name of the cookie
    • Value – a piece of data which you want to store
    • Expires – time during which cookies exist
    • Path – the path on the server in which the cookie will be available on
    • Domain – the (sub)domain that the cookie is available to
    • Secure – Indicates that the cookie should only be transmitted over a secure HTTPS connection from the client
    • httponly – When TRUE the cookie will be made accessible only through the HTTP protocol. This means that the cookie won’t be accessible by scripting languages, such as JavaScript
    setcookie(name, value, expire, path, domain, secure, httponly);

    Create

    To create cookies, you just need to add a few simple lines of PHP code to function.php file of you active theme or inside your custom plugin files. In the example below, you can see how to create a ‘map_data cookie’ cookie with 30 days lifetime which containing value ‘John’

    $cookie_name = 'mwp_data_cookie'; // set the name of the cookie
    $cookie_value = 'John'; // set the value of the cookie
    $cookie_expire = time() + 60*60*24*30; // set cookie lifetime for 30 days
    setcookie($cookie_name, $cookie_value, $cookie_expire); //  30 days

    Next piece of code will show you how to receive cookie value:

    // Now you can receive cookie value
    if(!isset($_COOKIE[$cookie_name])) {
            print 'Cookie "' . $cookie_name . '" does not exist';
    } else {
            print 'Cookie "' . $cookie_name . '" value is:'.$_COOKIE[$cookie_name];
    }

    Update

    In order to update cookie you need to overwrite it with a new one by using the same name.

    $cookie_name = 'mwp_data_cookie'; // set the name of the cookie
    $cookie_value = 'John Doe'; // set updated value of the cookie
    $cookie_expire = time() + 60*60*24*30; // set cookie lifetime for 30 days
    setcookie($cookie_name, $cookie_value, $cookie_expire); //  30 

    Delete

    If you want to delete the cookie you need to set date in the past, to trigger the removal process.

    $cookie_name = 'mwp_data_cookie';
    setcookie($cookie_name, '', time() - 3600); // set expiration date 1 hour ago

    If you don’t know how to program or don’t want to do it on your own, then you better find a good developer and assign this task to him. Or you can just contact us

    See Also: WordPress site health guide: How to get 100% check score?

  • Ошибка rpcs3 fatal error
  • Ошибка rpc сетевая ошибка 99 невозможно назначить запрошенный адрес
  • Ошибка rpc сервер rpc недоступен snmp неправильное сообщество или snmp недоступно
  • Ошибка rpc ошибка mit kerberos v5
  • Ошибка rpc ошибка krb5 сервера ald ошибка проверки сообщения krb priv