file_get_contents(): SSL operation failed with code 1, Failed to enable crypto

I’ve been trying to access this particular REST service from a PHP page I’ve created on our server. I narrowed the problem down to these two lines. So my PHP page looks like this: <?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; ?> The page dies on line 2 with the following errors: Warning: file_get_contents(): SSL operation … Read more

How can I handle the warning of file_get_contents() function in PHP?

I wrote a PHP code like this $site=”http://www.google.com”; $content = file_get_content($site); echo $content; But when I remove “http://” from $site I get the following warning: Warning: file_get_contents(www.google.com) [function.file-get-contents]: failed to open stream: I tried try and catch but it didn’t work. 17 Answers 17