【发布时间】:2016-08-25 10:24:08
【问题描述】:
当我上传带有邮政编码的 csv 文件时,它会转换并保存纬度和对数。将邮政编码转换为 lat,lng 时发生的错误。在我的本地主机中,它工作正常。当我在实时服务器中上传时。我收到此错误 Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /hermes/bosnaweb05a/b1410/ipg.rwdinfotechcom/vw/zipmapping/index.php 在线29 。我也检查了我的 google api 密钥。我无法添加 php.ini 文件。如果我上传 php.ini 文件,它会显示内部服务器错误。
Here my code
function getLnt($zip){
$url = "https://maps.googleapis.com/maps/api/geocode/json?key=AIzaSyDEGgYDar8y3Bx-1FpY3hq6ON4LufoRK60&address=
".urlencode($zip)."&sensor=false";
$result_string = file_get_contents($url);
$result = json_decode($result_string, true);
$result1[]=$result['results'][0];
$result2[]=$result1[0]['geometry'];
$result3[]=$result2[0]['location'];
return $result3[0];
}
【问题讨论】:
-
最好向我们展示您的 php.INI 而不是代码。
标签: php