我在PHP中使用谷歌地理编码脚本在我以前的主机上工作(仍在工作),但在hostgator中停止了我的VPS工作。
$url="http://maps.googleapis.com/maps/api/geocode/json?address=?Toronto,+ON&sensor=true";
$latlon = @file_get_contents($url);
$latlong =json_decode($latlon, true);
我也尝试过:
$curl_handle=curl_init();
curl_setopt($curl_handle,CURLOPT_URL, $url);
curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl_handle, CURLOPT_HEADER, 0);
$latlong = curl_exec($curl_handle);
curl_close($curl_handle);
两者都给出了
{
"status": "REQUEST_DENIED",
"results": [ ]
}
我尝试了Yahoo API,它确实有效! (但@file_get_contents
也不适用于雅虎。)
任何帮助都将不胜感激。
答案 0 :(得分:0)
似乎您每天限制调用google允许的webservice已过期。