What is the meaning of "php_network_getaddresses: getaddrinfo failed"?

609 Views Asked by At

What is the meaning of "php_network_getaddresses: getaddrinfo failed"?

when i'm using memcache, i found this "What is the meaning of "php_network_getaddresses: getaddrinfo failed"?" appears when running the methods of memcache.

1

There are 1 best solutions below

0
On

That usually means your DNS resolution is not working correctly. PHP cannot get the ip-address for hostnames used in the Memcache functions.

Your options

  • Check/fix that DNS-lookups can be done correctly.
  • Change your code to use ip-addresses instead of hostnames

Example

Memcache::connect("1.2.3.4");           // replace with correct ip
Memcache::getServerStatus("1.2.3.4");   // --- '' ---
// etc other functions using hostname