首页 > php开发 > php提示Warning: file_get_contents(): couldn’t resolve

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

在使用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 ……//phprm.com

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

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

vi /etc/resolv.conf

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

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

本文地址:http://www.phprm.com/develop/fs5823.html

转载随意,但请附上文章地址:-)

标签:warning:file_get_contents():

发表留言