File_get_contents () returns "Could not open stream" when clicking HTTPS

file_get_contents () returns "failed to open stream" when I call it at the https url.

Warning: file_get_contents(https://google.com) [function.file-get-contents]: failed to open stream: No error in E:\\htdocs\callback3.php on line 5 

The same call will work with a non-SSL URL.

At first I thought it was a security issue with my web browser, but I confirmed with phpinfo () that allowing the opening of the URL is indeed allowed. I also tried this code and checked its operation:

Anyone have any ideas why the get_contents () file does not work with the HTTPS URL?

update: People correctly pointed out that this is an HTTPS problem. My web host claims this should work, and has no idea how to solve it. Does anyone have specific instructions I can give them to configure IIS7?

+2
php facebook iis-7
source share
1 answer

This is probably because they use the secure https protocol. This is strange, although facebook provides a similar example in its examples.

+3
source

All Articles