3

I am building a new WordPress site for a client and all of a sudden today I am seeing this error at the top of the screen. I have never seen this before. Any ideas what could be causing this to happen now? Also how to fix it?

Warning: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /var/www/wp-includes/class-http.php on line 787

Warning: stream_socket_client(): unable to connect to tcp://www.MY-DOMAIN.com:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /var/www/wp-includes/class-http.php on line 787

enter image description here

3
  • It looks like whatever is at www.MY-DOMAIN.com:80 is not resolving properly. If you know what that is look at your hosts file and your DNS configuration. If you don't know what that is check all your code carefully for a hack.
    – user1864610
    Commented Apr 9, 2014 at 19:58
  • maybe a plugin is causing this due to a missconfiguration?
    – RicardoE
    Commented Apr 9, 2014 at 19:58
  • possible duplicate of php_network_getaddresses: getaddrinfo failed: Name or service not known. There's 231 of these. Why do you think the image of the site would help with a php warning?
    – Mike B
    Commented Apr 9, 2014 at 20:05

1 Answer 1

10

Not sure if you are using a VM but when I had this error I resolved it by adding an entry to my hosts file in my vagrant machine that pointed back to localhost.

127.0.0.1 www.MY-DOMAIN.com
2
  • I'm using Docker under AWS BeanStalk and it worked like a charm. Thank you. Commented Dec 5, 2014 at 10:57
  • Great! Sorted for me now also :-)
    – Richard
    Commented Jun 15, 2015 at 13:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.