getaddrinfo failed: No address associated with hostname

错误描述:

在做一个PHP的小程序时,CURL网址时,返回的信息一直显示错误。

ses: getaddrinfo failed: No address associated with hostname

解决办法:

使用代理 或者其他原因导致了,dns无法正常解析,更换可用的dns即可。

vi /etc/resolv.conf

nameserver     8.8.8.8

 

Leave A Comment

Please be polite. We appreciate that. Your email address will not be published and required fields are marked