Unable to find the wrapper "https" with file_get_contents

John Smith picture John Smith · Sep 5, 2013 · Viewed 43.1k times · Source

Calling file_get_contents() with https:// urls give me the following error:

warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?

I've read 10+ SO questions and all of them say to enable extension=php_openssl.dll

I did this and I'm still having issues...

What else could it be?

Answer

Amit Shah picture Amit Shah · Apr 20, 2017

SOLVED

To solve this error, you need to install the OpenSSL package for PHP on your webserver.

On a FreeBSD server, you may need to install the following package: php53_openssl and restart your webserver.

On a Windows server, open your php.ini config file and simply uncomment the following line:

 ;extension=php_openssl

and restart the webserver. The error should be resolved.

Reference: I leart it from this link which worked for me.., so credit goes to him.