Unable to find the wrapper “https”

Today I had to put a simple script on one of my hosting server where a “Facebook Login” button was available for login. However when I had to run it I encountered the following error:

Warning: file_get_contents() [function.file-get-contents]: Unable to find the wrapper “https” – did you forget to enable it when you configured PHP?

This was becouse the url served to file_get_contents start with http:// ….

If you have the same problem there are 2 steps to rezolve it:

  1. apache module ssl_module need to be avilble
  2. php extension php_openssl need to be activated too

Server restart and you are good to go.

To test from PHP is extension php_openssl is active just paste this code:

  1. if (extension_loaded(‘php_openssl’))
  2.    echo(‘php_openssl ok’);
  3. else
  4.    echo(‘php_openssl off’);

Tags: , , , , , ,

Comments are closed.