首页 > 开发 > PHP > 正文

php提示Warning: file_get_contents(): couldn’t resolve

2024-05-04 21:59:30
字体:
来源:转载
供稿:网友

在使用file_get_contents函数获取远程文件时提示Warning:file_get_contents():couldn’t resolve错误了,这个我们可以看出是dns的问题,解决办法也简单.

今天在使用一个Caiji功能的使用,突然间出现:

Warning: file_get_contents() [function.file-get-contents]: couldn't resolve host name in ……//Vevb.com

而本地测试却没有问题,从网上查了一些资料,发现是dns的问题,下面是解决方法:

用ssh连接linux vps,修改vps主机的dns.

vi /etc/resolv.conf

里面的内容直接修改成:nameserver 114.114.114.114  nameserver 8.8.8.8

保存即可,不用重启,再次测试,OK.

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表