1

I am using file_get_contents to get api result from a URL in json format. However, there is an issue in file_get_contents when i call the url. The error returns is

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

The url im using is calling a load balancer server before forward to the main api server. If i were to directly change the url to main api server ip address, i am able to get the results. However, if i call through load balancer url it returns error message

Is it something i need to configure in loadbalancer server?

  • update: seems to be a domain name issue? i tried calling using load balancer direct IP address. it is working. But when i switch back to a domain name url, it is failing.
Kimberlee Ho
  • 447
  • 1
  • 6
  • 23
  • 2
    Possible duplicate of [file\_get\_contents(): php\_network\_getaddresses: getaddrinfo failed: Name or service not known](http://stackoverflow.com/questions/20064372/file-get-contents-php-network-getaddresses-getaddrinfo-failed-name-or-servi) – Script47 Jan 07 '16 at 11:09

1 Answers1

0

I'm actually calling a internal server api domain. So, i had to configure the server host file.

Kimberlee Ho
  • 447
  • 1
  • 6
  • 23