用七牛获取文件信息报错Could not resolve host: rsf.qbox.me

object(Qiniu\Http\Error)#8 (2) {
["url":"Qiniu\Http\Error":private]=>
string(64) "http://rsf.qbox.me/list?bucket=xhdome&prefix=10000q_n&limit=10..."
["response":"Qiniu\Http\Error":private]=>
object(Qiniu\Http\Response)#9 (6) {
["statusCode"]=>
int(-1)
["headers"]=>
array(0) {
}
["body"]=>
NULL
["error"]=>
string(35) "Could not resolve host: rsf.qbox.me"
["jsonData":"Qiniu\Http\Response":private]=>
NULL
["duration"]=>
float(20.53)
}
}
上面是报错的完整信息
下面是我的代码

阅读 5.6k
2 个回答

应该是rsf.qbox.me这个服务器有时能ping通,有时又ping不通的缘故

====> list file err:
object(Qiniu\Http\Error)#17 (2) {
  ["url":"Qiniu\Http\Error":private]=>
  string(44) "http://rsf.qbox.me/list?bucket=comic&limit=3"
  ["response":"Qiniu\Http\Error":private]=>
  object(Qiniu\Http\Response)#18 (6) {
    ["statusCode"]=>
    int(-1)
    ["headers"]=>
    array(0) {
    }
    ["body"]=>
    NULL
    ["error"]=>
    string(35) "Could not resolve host: rsf.qbox.me"
    ["jsonData":"Qiniu\Http\Response":private]=>
    NULL
    ["duration"]=>
    float(2.512)
  }
}
新手上路,请多包涵

临时解决的办法
找到 rsf.qbox.me 的 ip xxx.xxx.xxx.xxx
在hosts文件中添加
xxx.xxx.xxx.xxx rsf.qbox.me

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进