原代码:

<?php
$response = file_get_contents("https://maps.co.weber.ut.us/arcgis/rest/services/SDE_composite_locator/GeocodeServer/findAddressCandidates?Street=&SingleLine=3042+N+1050+W&outFields=*&outSR=102100&searchExtent=&f=json");

echo $response; ?>
报错 file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL ...

修改后
<?php
$arrContextOptions=array(
    "ssl"=>array(
        "verify_peer"=>false,
        "verify_peer_name"=>false,
    ),
);  

$response = file_get_contents("https://maps.co.weber.ut.us/arcgis/rest/services/SDE_composite_locator/GeocodeServer/findAddressCandidates?Street=&SingleLine=3042+N+1050+W&outFields=*&outSR=102100&searchExtent=&f=json", false, stream_context_create($arrContextOptions));

echo $response; ?>

帮助文档:http://php.net/manual/en/migration56.openssl.php

相关文章:

  • 2021-12-17
  • 2021-06-07
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
猜你喜欢
  • 2022-03-06
  • 2022-02-01
  • 2022-12-23
  • 2021-06-27
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案