Curl error как исправить

you can generate curl error after its execution

$url = 'http://example.com';

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
if(curl_errno($ch)){
    echo 'Request Error:' . curl_error($ch);
}

and here are curl error code

if someone need more information about curl errors

<?php

    $error_codes=array(
    [1] => 'CURLE_UNSUPPORTED_PROTOCOL',
    [2] => 'CURLE_FAILED_INIT',
    [3] => 'CURLE_URL_MALFORMAT',
    [4] => 'CURLE_URL_MALFORMAT_USER',
    [5] => 'CURLE_COULDNT_RESOLVE_PROXY',
    [6] => 'CURLE_COULDNT_RESOLVE_HOST',
    [7] => 'CURLE_COULDNT_CONNECT',
    [8] => 'CURLE_FTP_WEIRD_SERVER_REPLY',
    [9] => 'CURLE_REMOTE_ACCESS_DENIED',
    [11] => 'CURLE_FTP_WEIRD_PASS_REPLY',
    [13] => 'CURLE_FTP_WEIRD_PASV_REPLY',
    [14]=>'CURLE_FTP_WEIRD_227_FORMAT',
    [15] => 'CURLE_FTP_CANT_GET_HOST',
    [17] => 'CURLE_FTP_COULDNT_SET_TYPE',
    [18] => 'CURLE_PARTIAL_FILE',
    [19] => 'CURLE_FTP_COULDNT_RETR_FILE',
    [21] => 'CURLE_QUOTE_ERROR',
    [22] => 'CURLE_HTTP_RETURNED_ERROR',
    [23] => 'CURLE_WRITE_ERROR',
    [25] => 'CURLE_UPLOAD_FAILED',
    [26] => 'CURLE_READ_ERROR',
    [27] => 'CURLE_OUT_OF_MEMORY',
    [28] => 'CURLE_OPERATION_TIMEDOUT',
    [30] => 'CURLE_FTP_PORT_FAILED',
    [31] => 'CURLE_FTP_COULDNT_USE_REST',
    [33] => 'CURLE_RANGE_ERROR',
    [34] => 'CURLE_HTTP_POST_ERROR',
    [35] => 'CURLE_SSL_CONNECT_ERROR',
    [36] => 'CURLE_BAD_DOWNLOAD_RESUME',
    [37] => 'CURLE_FILE_COULDNT_READ_FILE',
    [38] => 'CURLE_LDAP_CANNOT_BIND',
    [39] => 'CURLE_LDAP_SEARCH_FAILED',
    [41] => 'CURLE_FUNCTION_NOT_FOUND',
    [42] => 'CURLE_ABORTED_BY_CALLBACK',
    [43] => 'CURLE_BAD_FUNCTION_ARGUMENT',
    [45] => 'CURLE_INTERFACE_FAILED',
    [47] => 'CURLE_TOO_MANY_REDIRECTS',
    [48] => 'CURLE_UNKNOWN_TELNET_OPTION',
    [49] => 'CURLE_TELNET_OPTION_SYNTAX',
    [51] => 'CURLE_PEER_FAILED_VERIFICATION',
    [52] => 'CURLE_GOT_NOTHING',
    [53] => 'CURLE_SSL_ENGINE_NOTFOUND',
    [54] => 'CURLE_SSL_ENGINE_SETFAILED',
    [55] => 'CURLE_SEND_ERROR',
    [56] => 'CURLE_RECV_ERROR',
    [58] => 'CURLE_SSL_CERTPROBLEM',
    [59] => 'CURLE_SSL_CIPHER',
    [60] => 'CURLE_SSL_CACERT',
    [61] => 'CURLE_BAD_CONTENT_ENCODING',
    [62] => 'CURLE_LDAP_INVALID_URL',
    [63] => 'CURLE_FILESIZE_EXCEEDED',
    [64] => 'CURLE_USE_SSL_FAILED',
    [65] => 'CURLE_SEND_FAIL_REWIND',
    [66] => 'CURLE_SSL_ENGINE_INITFAILED',
    [67] => 'CURLE_LOGIN_DENIED',
    [68] => 'CURLE_TFTP_NOTFOUND',
    [69] => 'CURLE_TFTP_PERM',
    [70] => 'CURLE_REMOTE_DISK_FULL',
    [71] => 'CURLE_TFTP_ILLEGAL',
    [72] => 'CURLE_TFTP_UNKNOWNID',
    [73] => 'CURLE_REMOTE_FILE_EXISTS',
    [74] => 'CURLE_TFTP_NOSUCHUSER',
    [75] => 'CURLE_CONV_FAILED',
    [76] => 'CURLE_CONV_REQD',
    [77] => 'CURLE_SSL_CACERT_BADFILE',
    [78] => 'CURLE_REMOTE_FILE_NOT_FOUND',
    [79] => 'CURLE_SSH',
    [80] => 'CURLE_SSL_SHUTDOWN_FAILED',
    [81] => 'CURLE_AGAIN',
    [82] => 'CURLE_SSL_CRL_BADFILE',
    [83] => 'CURLE_SSL_ISSUER_ERROR',
    [84] => 'CURLE_FTP_PRET_FAILED',
    [84] => 'CURLE_FTP_PRET_FAILED',
    [85] => 'CURLE_RTSP_CSEQ_ERROR',
    [86] => 'CURLE_RTSP_SESSION_ERROR',
    [87] => 'CURLE_FTP_BAD_FILE_LIST',
    [88] => 'CURLE_CHUNK_FAILED');

    ?>

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!

Check Out Our Video Guide To Fixing the “cURL Error 28: Connection Timed Out”

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!

Setup cURL in Windows

cURL (client URL) is a command line tool that system admins and developers use to transfer data between server and client in the form of a URL. It supports several different protocols and has a variety of applications. I will not cover the details and applications of cRUL here. If you’re already on this page, I am assuming you know how to use it. Learn how to use curl in Windows if you are just getting started with it.

cURL in Windows 10 version 1803 or higher

Starting with Windows 10 (version 1803) or Server 2019, you will find curl.exe pre-installed in your %systemroot%System32 directory by default. This guide is useful if you are on an older Windows version or you want to use the latest curl version from official website, which supports more protocols than the built-in curl version. I will also cover how to fix some most common errors that you might face while using cURL in Windows.

Most Common Errors with Secure Websites

You will get a whole lot of different errors while using secure URLs with cURL. So if you’re getting any error among the below mentioned errors, you are on the right page.

curl: (35) schannel: next InitializeSecurityContext failed

curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.

curl - (35) schannel - next InitializeSecurityContext failed - Unknown error (0x80092012)

If you get this error message, it indicates that curl was unable to check revocation for the certificate which is the default behavior when it comes to communication with secure websites. Even though you could easily circumvent this error by using the --ssl-no-revoke argument with curl command but it becomes tedious when you use curl command a lot. The following command shows how to bypass this error:

curl --ssl-no-revoke --head https://www.techtutsonline.com/

To learn how to get around this error once and for all – without having to specify the --ssl-no-revoke argument each time, see the Setup the latest version of cURL in Windows section.

curl: (60) SSL certificate problem

curl: (60) SSL certificate problem: unable to get local issuer certificate

curl - (60) SSL certificate problem - unable to get local issuer certificate

If you get this error, it means there is something wrong with root certificate that curl is using on your local system. To get around this error, you could use the --insecure (or -k for short) argument with curl command as shown in the following command:

curl --insecure https://www.techtutsonline.com/

Again, to learn how to get around this error once and for all, see the Setup the latest version of cURL in Windows section.

curl: (60) schannel: CertGetCertificateChain trust error

curl: (60) schannel: CertGetCertificateChain trust error CERT_TRUST_IS_UNTRUSTED_ROOT

curl - (60) schannel - CertGetCertificateChain trust error CERT_TRUST_IS_UNTRUSTED_ROOT

If you see this error, it means the root CA that curl is configured to use is untrusted. It may be using a self-signed certificate or the certificate is no longer valid. This error can also be bypassed by using the --insecure argument with curl command as shown in previous example.

Setup the latest version of cURL in Windows

Depending upon the edition of your Windows, you can download the latest version of cURL from the official website using the following links:

  • For 64-bit Windows
  • For 32-bit Windows

It will download a zip archive. There is no installer in this file so you will have to manually set the PATH environment for curl.exe binary. Once downloaded, you can extract the zip archive to any folder of your choice. I extracted mine inside D:WORKSOFTWAREcurl-7.81.0-win64 directory. Your directory should look like shown in the following screenshot:

curl directory path

Now to set the PATH environment variable, open RUN dialog (WinLogoKey+R), type “sysdm.cpl ,3” without quotes and press enter. This will open up advanced system properties page. Now follow the steps mentioned in the screenshot and click on OK thrice to save the changes.

Add CURL to Path Environment VariableMake sure you specify the correct path to bin directory in STEP 5. I added D:WORKSOFTWAREcurl-7.81.0-win64bin in my case.

When this is done, curl is ready to be used on your system. To confirm, you can open the command prompt and type curl --version command. If you see the curl version as shown in the following image, you’re all set to go to next step:
Check curl version
If you get an error that says ‘curl’ is not recognized as an internal or external command, operable program or batch file, it means something is wrong with the PATH environment variable you created.
'curl' is not recognized as an internal or external command, operable program or batch file
If you see this error, please follow the steps mentioned in this video to properly setup your PATH environment variable.

Certificate Setup for cURL

Now comes the most important part. At this point, when you try any secure URL with curl command, you will most probably get an error as we discussed in past sections. To permanently fix those SSL errors, you need to download the CA certificate file from official website and configure the curl on your system to use that certificate file. To do that, follow these steps:

  1. First of all, download the CA certificate file and copy it into the same directory where curl.exe file is available. To get the location of curl.exe, you could simply type where curl command in your command prompt.
    locate curl curl
  2. Now create a new file named .curlrc in the same directory as that of curl.exe. In the end, your curl directory should look like shown in the following image:
    set curl to use the cacert in .curlrc file
  3. Now open the .curlrc file in notepad (or any other text editor) and set the complete path of root certificate file that you downloaded in first step. See the screenshot for reference:
    set cacert path in .curlrc file
    Please remember to use the forward slash (/) while specifying directory path as shown below otherwise it won’t work:

    cacert = "D:/WORK/SOFTWARE/curl-7.81.0-win64/bin/cacert.pem"
    
  4. [optional] If you’re using Windows 10 (version 1803) or higher, your system will most likely have curl.exe in %systemroot%System32 directory as well. When you will run curl command without explicitly specifying the complete path to curl.exe executable, your system will use the default executable located in %systemroot%System32. If this is true you will see curl.exe twice when you run where curl command. See the following image for reference:
    locate curl executable duplicate
    If you see the same, you need to get rid of default curl.exe that comes with Windows. You can take the ownership of file, set the permissions and then rename the file with the help of following commands:

    cd C:WindowsSystem32 
    takeown /a /f curl.exe
    icacls curl.exe /grant administrators:F
    ren curl.exe curl.exe.bak

    Make sure you run these commands in an elevated command prompt. See the following screenshot for reference:
    take ownership of default curl and rename

  5. Once you successfully rename the default curl.exe executable, you should see a single instance of curl.exe when running where curl command.
  6. Your system is now all set and you can start using curl without any SSL error. The following screenshot shows that I no longer get any SSL error and I don’t have to use the --insecure or --ssl-no-revoke arguments anymore.
    curl -I https://www.techtutsonline.com/

    curl success

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.

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

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

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

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

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

Вы видите ошибку «error cURL 28: Connection timed out» на вашем сайте WordPress?

Ошибка cURL 28 — это распространенная проблема WordPress REST API, которая может повлиять на производительность вашего веб-сайта и привести к его непредсказуемому поведению.

В этой статье мы покажем вам, как легко исправить проблему «error cURL 28: Connection timed out» на вашем веб-сайте WordPress.

Что такое cURL в WordPress?

CURL — это программная утилита, используемая WordPress и многими другими веб-приложениями для отправки и получения запросов данных с использованием URL-адресов.

WordPress использует cURL для обработки нескольких запросов API. Он доступен как расширение языка программирования PHP.

Библиотека cURL играет решающую роль в том, как WordPress работает за кулисами. Если он не настроен должным образом, ваш веб-сайт WordPress не будет работать должным образом.

Что вызывает ошибку cURL 28 в WordPress?

Неспособность своевременно ответить на запросы данных сервера вызывает ошибку 28 cURL в WordPress.

WordPress использует REST API (метод программирования) для отправки и получения запросов данных. Если время ожидания этих запросов истекло, вы увидите это как критическую проблему в отчете о работоспособности сайта с заголовком «error REST API».

Расширение ошибки покажет вам дополнительную информацию, включая сообщение об ошибке:

Error: cURL error 28: Operation timed out after x milliseconds with x 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.’

Что может вызвать тайм-аут cURL?

Ряд сценариев может вызвать тайм-аут cURL в WordPress.

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

Если ваш DNS-сервер работает некорректно, это также может привести к сбою HTTP-запросов и вызвать ошибку тайм-аута cURL в WordPress.

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

При этом давайте посмотрим, как устранить и исправить проблему ‘curl error 28: Connection timed out’ в 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 или выше.

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

4. Устранение проблем с небезопасным контентом SSL

Если ваш сайт WordPress использует HTTPS/SSL, но не настроен должным образом, это также может привести к тому, что ваш веб-сервер заблокирует небезопасные запросы cURL.

Точно так же, если ваш сайт WordPress не использует HTTPS/SSL, но он сделал вызов API с использованием URL-адреса HTTP, то эти запросы тоже завершатся ошибкой, и вместо этого вы можете увидеть следующую ошибку cURL:

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

Чтобы исправить это, вы можете попросить своего хостинг-провайдера переустановить сертификат SSL для вашего сайта.

5. Обратитесь за помощью к поставщику услуг хостинга.

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

Есть много факторов, которые могут контролироваться и исправляться только вашей хостинговой компанией. Например, если их DNS-серверы не могут своевременно разрешать запросы, это приведет к тайм-ауту запросов cURL.

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

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

Мы надеемся, что эта статья помогла вам узнать, как исправить ошибку cURL 28 в WordPress.

Если вы нашли ошибку, пожалуйста, выделите фрагмент текста и нажмите Ctrl+Enter.

Понравилась статья? Поделить с друзьями:
  • Как найти сок в классе
  • Как найти могилу родственника в казахстане
  • Как найти массу атома брома
  • Как составить иск в трудовую инспекцию
  • Как найти силу тока в прямолинейном проводнике