file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known php php

file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known


It means your server cannot connect to the outside world

This probably won't change anything given the DNS issues

So, If you have permission, try changing the name servers in your /etc/resolv.conf file to other nameservers.


There should be as well httpd allowed to connect outside. Check you selinux policy.this helps me to solve connection problem:

setsebool -P nis_enabled 1setsebool -P httpd_can_network_connect 1


In reference to one of the comments by @DUzun, and for those like myself who are familiar with the server in general but not a computer science major, I fixed the issue on Linux/Centos6 (Plesk Onyx) by:

1) Opening /etc/resolv.conf (my file was empty)

2) Added:

nameserver 8.8.8.8nameserver 8.8.4.4options rotateoptions timeout:3

Hopefully this helps someone out there.