简体   繁体   English

WAMP/Wordpress - cURL 错误 28:操作在 10001 毫秒后超时,收到 0 个字节

[英]WAMP/Wordpress - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received

I have been stuck with this error for quite some time now.我已经被这个错误困扰了很长一段时间了。 Earlier I got this error on godaddy and asked it over here .早些时候我在godaddy上得到了这个错误,并在这里问了它。 Now I'm getting it on hostinger shared hosting.现在我在托管共享主机上得到它。 So I migrated the production copy to local wamp server.所以我将生产副本迁移到本地 wamp 服务器。 I got the same error in the local copy as well.我在本地副本中也遇到了同样的错误。

Most of the people are suggesting it's a server error and stating the following rectification:大多数人都认为这是服务器错误并说明以下纠正:

  1. Check if the server is running latest version of PHP and the cURL library.检查服务器是否正在运行最新版本的 PHP 和 cURL 库。 Update Wordpress and plugins.更新 Wordpress 和插件。

     - The local copy is running PHP 7.4.6 and the curl library packaged with it. Wordpress, plugins are up to date.
  2. Increase server memory limit增加服务器memory限制

     - I tried many different combinations of settings. The current settings are: memory_limit = 256M upload_max_size = 64M post_max_size = 64M upload_max_filesize = 64M max_execution_time = 300 max_input_time = 1000

    I tried increasing the memory limit and post max size but it does not solve the issue.我尝试增加 memory 限制和发布最大大小,但它不能解决问题。

  3. It could be DNS related issue, switch to OpenDNS可能是 DNS 相关问题,切换到 OpenDNS

    • I am getting it on localhost.我在本地主机上得到它。
  4. Ask your host if there is some limitation with wp-cron, or if loopback is disabled.询问您的主机 wp-cron 是否有一些限制,或者是否禁用了环回。

  5. Ask your host if there a firewall or security modules (eg mod_security ) that could block the outgoing cURL requests.询问您的主机是否有防火墙或安全模块(例如 mod_security )可以阻止传出的 cURL 请求。

Please suggest how should I check for 4 and 5 on wamp server.请建议我应该如何在 wamp 服务器上检查 4 和 5。 Is there something I'm missing in terms of php settings.在 php 设置方面我有什么遗漏吗?

Error Source - http://jrventurefzellc.com/错误来源 - http://jrventurefzellc.com/

Thank you for your time.感谢您的时间。

This issue tell you that the remote script was still running when your curl cut off the connection.这个问题告诉您,当您的 curl 切断连接时,远程脚本仍在运行。 You have to add a timeout option into your curl request: :)您必须在 curl 请求中添加超时选项::)

In wordpress for example以 wordpress 为例

$response = wp_remote_post( $url, array(
    'method'      => 'POST',
    'timeout'     => 45, // <--- this option
    'headers'     => array(),
    'body'        => array(
        'username' => 'bob',
        'password' => '1234xyz'
    )
);

Or PHP curl或 PHP curl

curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); 
curl_setopt($ch, CURLOPT_TIMEOUT, 400); //timeout in seconds

After a lot of playing around with php settings, this error was solved with the following PHP settings:经过大量使用 php 设置后,通过以下 PHP 设置解决了此错误:

max_execution_time = 30
max_input_time = 300
memory_limit = 128M
post_max_size = 32M
upload_max_size = 32M

I believe the problem was due to max_execution_time settings.我相信问题是由于 max_execution_time 设置。 Most of the guides suggested to increase it to 1000 along with increasing memory_limit, but that would lead to long load time.大多数指南建议将其增加到 1000,同时增加 memory_limit,但这会导致加载时间过长。 Tried it on a GoDaddy hosted website as well and it seems to work very well.也在 GoDaddy 托管的网站上尝试过,似乎效果很好。

Update:更新:

After a couple of days, this error had again shown up on the site.几天后,这个错误再次出现在网站上。 Later, through an inspection of function.php, I found that the issue was due to Wp-vcd malware.后来通过检查function.php,发现问题是由Wp-vcd恶意软件引起的。 Removing the respective malware code and files solved it.删除相应的恶意软件代码和文件解决了它。 WP-VCD 影响卷曲

You need to increase the timeout parameter.您需要增加超时参数。 I was facing same issue and it's solved it like a magic:我遇到了同样的问题,它像魔术一样解决了它:

$response = wp_remote_get( $url,
    array(
        'timeout'     => 60, // <-- this one increase to 120 or more
    )
);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Wordpress/Godaddy - cURL 错误 28:操作在 10001 毫秒后超时,收到 0 个字节 - Wordpress/Godaddy - cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received cURL 错误 28:操作在 2000 毫秒后超时,收到 23000995 个字节中的 7276200 个 - cURL error 28: Operation timed out after 2000 milliseconds with 7276200 out of 23000995 bytes received 下载失败。 cURL 错误 28:连接在 10001 毫秒后超时 - Download failed. cURL error 28: Connection timed out after 10001 milliseconds cURL 错误 #:操作在 50007 毫秒后超时,收到 272389 个字节中的 30461 个 - cURL Error #:Operation timed out after 50007 milliseconds with 30461 out of 272389 bytes received php cURL操作在120308毫秒后超时,X收到-1个字节 - php cURL Operation timed out after 120308 milliseconds with X out of -1 bytes received Curl 总是超时,操作在 30001 毫秒后超时,收到 0 个字节 - Curl always timeout, Operation timed out after 30001 milliseconds with 0 bytes received LaravelFacebookSDK操作在0毫秒后超时,收到0个字节中的0个 - LaravelFacebookSDK Operation timed out after 0 milliseconds with 0 out of 0 bytes received curl php操作在120000毫秒后超时,收到234570字节 - curl php Operation timed out after 120000 milliseconds with 234570 bytes received cURL 错误 28:5001 毫秒后解析超时 - cURL error 28: Resolving timed out after 5001 milliseconds cURL 错误 28 - x 毫秒后连接超时 - cURL error 28 - Connection timed out after x milliseconds
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM