项目上传到linux服务器出现Couldn't resolve host 'api.qiniu.com'

新手上路,请多包涵

本地运行没问题,上传到linux服务器中,出现Trying to get property of non-object的错误

问题出现的环境背景及自己尝试过哪些方法

clipboard.png

相关代码

// 请把代码文本粘贴到下方(请勿用图片代替代码)
打印$zone是这样的
Array ( [0] => [1] => QiniuHttpError Object ( [url:QiniuHttpError:private] => https://api.qiniu.com/v2/quer... [response:QiniuHttpError:private] => QiniuHttpResponse Object ( [statusCode] => -1 [headers] => Array ( ) [body] => [error] => Couldn't resolve host 'api.qiniu.com' [jsonData:QiniuHttpResponse:private] => [duration] => 0.001 ) ) )

[8] ErrorException in Config.php line 46

Trying to get property of non-object

  1. {
  2. $zone = $this->getZone($accessKey, $bucket);
  3. print_r($zone);
  4. if ($this->useHTTPS === true) {
  5. $scheme = "https://";
  6. } else {
  7. $scheme = "http://";
  8. }

45.

  1. $host = $zone->srcUpHosts[0];
  2. if ($this->useCdnDomains === true) {
  3. $host = $zone->cdnUpHosts[0];
  4. }

50.

  1. return $scheme . $host;

你期待的结果是什么?实际看到的错误信息又是什么?

阅读 2.4k
1 个回答

dns解析的问题,
换一个网络环境或者把dns换成180.76.76.76

推荐问题
logo
七牛云问答
子站问答
访问
宣传栏