本地运行没问题,上传到linux服务器中,出现Trying to get property of non-object的错误
问题出现的环境背景及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
打印$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
- {
- $zone = $this->getZone($accessKey, $bucket);
- print_r($zone);
- if ($this->useHTTPS === true) {
- $scheme = "https://";
- } else {
- $scheme = "http://";
- }
45.
- $host = $zone->srcUpHosts[0];
- if ($this->useCdnDomains === true) {
- $host = $zone->cdnUpHosts[0];
- }
50.
- return $scheme . $host;
dns解析的问题,
换一个网络环境或者把dns换成180.76.76.76