Tag Archives: PHP getaddrinfo failed

php_network_getaddresses: getaddrinfo failed

In general, when calling external service requests, sometimes due to configuration problems, PHP will report a PHP_ network_ Error in getaddresses: getaddrinfo failed: name or servicenot known:

 

reason:

PHP host cannot connect to DNS server

Analysis: for example, what is your access request www.leyangjuntestxxxx.com Our services

You can: Ping or   Telnet to see whether the domain can be accessed, whether there is a response

If you can’t Ping, your service is connected to a DNS server with problems

 

General solution:

1: You need to check whether the requested remote host is in/etc/hosts of the local machine

2: Need to check the rules of the firewall, is it blocked by the response

3: You can manually bind the host in the/etc/hosts file