[英]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:大多数人都认为这是服务器错误并说明以下纠正:
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.
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 限制和发布最大大小,但它不能解决问题。
It could be DNS related issue, switch to OpenDNS可能是 DNS 相关问题,切换到 OpenDNS
Ask your host if there is some limitation with wp-cron, or if loopback is disabled.询问您的主机 wp-cron 是否有一些限制,或者是否禁用了环回。
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.
删除相应的恶意软件代码和文件解决了它。
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.