bash curl: (56) 从对端接收数据时失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23442876/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
curl: (56) Failure when receiving data from the peer
提问by jojojohn
hello Im on shared hosting and I am able to ssh in and run the following command
你好,我在共享主机上,我可以通过 ssh 登录并运行以下命令
curl -O http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ
and it seems to work OK and gives the following output which looks pretty good to me
它似乎工作正常并提供以下输出,对我来说看起来不错
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 14 0 14 0 0 35 0 --:--:-- --:--:-- --:--:-- 35
but Im running it from cron using a script called reoccuringinvoices.sh The contents of the script is simply
但我使用名为 reoccuringinvoices.sh 的脚本从 cron 运行它脚本的内容很简单
#!/bin/bash
curl -O http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ
but when I run this version from cron it returns the following:
但是当我从 cron 运行这个版本时,它返回以下内容:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (56) Failure when receiving data from the peer
To be honest Im totally confused and any help to start to understand whats happening would be greatly appreciated
老实说,我完全糊涂了,如果能帮助您了解正在发生的事情,我们将不胜感激
回答by bedna
Use wget instead curl
使用 wget 代替 curl
wget http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ
wget http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ
Curl have permissions on write?
Curl 有写权限吗?
Maybe create curl log
也许创建卷曲日志
curl -O http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ 2>&1 | tee curl.log
Or change -O at -v and see log
或者在 -v 处更改 -O 并查看日志
curl -v http://myurl.co.uk/customers/cron/invoices/gIsoaGANyWlJ 2>&1 | tee curl.log