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

JasonDavis
  • 48,204
  • 100
  • 318
  • 537
  • 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. –  Apr 09 '14 at 19:58
  • maybe a plugin is causing this due to a missconfiguration? – RicardoE Apr 09 '14 at 19:58
  • possible duplicate of [php\_network\_getaddresses: getaddrinfo failed: Name or service not known](http://stackoverflow.com/questions/2661546/php-network-getaddresses-getaddrinfo-failed-name-or-service-not-known). [There's 231 of these](http://stackoverflow.com/search?q=php_network_getaddresses%3A+getaddrinfo+failed). Why do you think the image of the site would help with a php warning? – Mike B Apr 09 '14 at 20:05

1 Answers1

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
cbaigorri
  • 2,467
  • 25
  • 26