Home > Backend Development > PHP Tutorial > 七牛上传,报错 Could not resolve host: up.qiniu.com

七牛上传,报错 Could not resolve host: up.qiniu.com

WBOY
Release: 2016-06-06 20:34:40
Original
2638 people have browsed it

错误代码:
Qiniu\Http\Errorresponse:
body: null
duration: 0.005
error: "Could not resolve host: up.qiniu.com"
headers: []
statusCode: -1
Qiniu\Http\Errorurl: "http://up.qiniu.com"

ping up.qiniu.com 能够ping通
ping up.qiniu.com
PING bc-gate-io.qiniu.com (106.38.227.29) 56(84) bytes of data.
64 bytes from 106.38.227.29: icmp_seq=1 ttl=50 time=161 ms
64 bytes from 106.38.227.29: icmp_seq=2 ttl=50 time=180 ms
64 bytes from 106.38.227.29: icmp_seq=3 ttl=50 time=180 ms
64 bytes from 106.38.227.29: icmp_seq=4 ttl=50 time=164 ms
64 bytes from 106.38.227.29: icmp_seq=5 ttl=50 time=167 ms
64 bytes from 106.38.227.29: icmp_seq=7 ttl=50 time=164 ms

这是为何呀?

回复内容:

错误代码:
Qiniu\Http\Errorresponse:
body: null
duration: 0.005
error: "Could not resolve host: up.qiniu.com"
headers: []
statusCode: -1
Qiniu\Http\Errorurl: "http://up.qiniu.com"

ping up.qiniu.com 能够ping通
ping up.qiniu.com
PING bc-gate-io.qiniu.com (106.38.227.29) 56(84) bytes of data.
64 bytes from 106.38.227.29: icmp_seq=1 ttl=50 time=161 ms
64 bytes from 106.38.227.29: icmp_seq=2 ttl=50 time=180 ms
64 bytes from 106.38.227.29: icmp_seq=3 ttl=50 time=180 ms
64 bytes from 106.38.227.29: icmp_seq=4 ttl=50 time=164 ms
64 bytes from 106.38.227.29: icmp_seq=5 ttl=50 time=167 ms
64 bytes from 106.38.227.29: icmp_seq=7 ttl=50 time=164 ms

这是为何呀?

dns 问题
解决方案:
vim /etc/resolvconf/resolv.conf.d/base
添加:
nameserver 8.8.8.8
nameserver 114.114.114.114

rm /etc/resolv.conf
ln -s ../run/resolvconf/resolv.conf /etc/resolv.conf
resolvconf -u

service networking restart
/etc/init.d/networking restart

修改本地DNS,修改为8.8.8.8或者114.114.114.114,试下是否可以正常上传;另外还可以在Qiniu\Config.php中,将UPLOAD_HOST修改为updx.qiniu.com,尝试下是否可以正常上传。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template