Unable to find the wrapper "https" - Did you Forget to enable it when you configured PHP?

Asked

Viewed 2,181 times

0

When launching a script PHP I had a nice surprise :

Warning: file_get_contents(): Unable to find the wrapper "https" - Did you Forget to enable it when you configured PHP?

Here’s an excerpt from my code PHP:

<?php

$siteUrl = 'http://cnet.com';

$requestUrl = 'https://opengraph.io/api/1.0/site/' . urlencode($siteUrl);

$siteInformationJSON = file_get_contents($requestUrl);
$siteInformation = json_decode($siteInformationJSON, true);

Is there any extension missing ?

  • You need the extension php_openssl.

  • in the English stack there is a question similar to your:https://stackoverflow.com/questions/1975461/how-to-get-file-get-contents-to-work-with-https

1 answer

1

Go to your file php.ini and check if the extension php_openssl.dll is like a ; (point and comma) in front. Ai you can insert this way:

extension = php_openssl.dll 

Once done, restart Apache and try again.

  • 1

    That answer of yours helped me so much, man. vlw! vlw! ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.