PHP error: php_network_getaddresses: getaddrinfo failed: (while getting information from other site.)

后端 未结 11 1133
时光说笑
时光说笑 2020-12-01 10:18

Trying to get information from an external source, I\'m receiving the following error:

Warning: php_network_getaddresses: getaddrinfo

11条回答
  •  醉酒成梦
    2020-12-01 10:58

    Although I didn't use this exact function I got this same error.

    In my case I just had to remove the protocol.

    Instead of $uri = "http://api.hostip.info/?ip=$ip&position=true";

    Use $uri = "api.hostip.info/?ip=$ip&position=true";

    And it worked fine afterwards

提交回复
热议问题