Home  >  Article  >  php教程  >  php提示Warning: file_get_contents(): couldn’t resolve

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

WBOY
WBOYOriginal
2016-06-13 09:29:591768browse

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

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

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

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

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

  vi /etc/resolv.conf

  里面的内容直接修改成:

  nameserver 114.114.114.114

  nameserver 8.8.8.8

  保存即可,不用重启。

  再次测试,OK!

Statement:
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