누군가가이 문제를 해결할 수 있습니까? 나는 PHP 위도와 경도로 주소를 알아야한다.프록시 문제! PHP에서 simplexml_load_file을 사용하여
내가 뭐하고 있었 :
$ 주소를 =를 urlencode ('내 주소');
$ lat_lng = simplexml_load_file ("http://maps.google.com/maps/api/geocode/xml?address= {$ address} & sensor = false");
그러나 나는이 경고를 가지고 :
메시지 : simplexml_load_file()을 [function.simplexml로드 파일] : php_network_getaddresses : 실패한다 getaddrinfo : 이름 해상도 임시 실패
프록시를 구성해야이 방식으로 변경해야한다고 생각합니다.
$ address = urlencode ('my address');
$ ch = curl_init ("http://maps.google.com/maps/api/geocode/xml?address= {$ address} & sensor = false");
curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ ch, CURLOPT_PROXY, 'my_proxy);
curl_setopt ($ ch, CURLOPT_PROXYPORT, 'my + port');
$ lat_lng = simplexml_load_string (curl_exec ($ ch));
curl_close ($ ch);
curl_exec
으로 전화하면 차단 된 것으로 보입니다.