file_get_contents() returns "failed to open stream" when hitting HTTPS

Posted by TMC on Stack Overflow See other posts from Stack Overflow or by TMC
Published on 2010-05-11T08:26:31Z Indexed on 2010/05/12 3:34 UTC
Read the original article Hit count: 248

Filed under:
|
|

file_get_contents() is returning "failed to open stream" when I call it on an 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

Same call will work with a non-SSL URL.

At first, I thought it was a security issue with my webhoster, but I have verified with phpinfo() that allow url open is indeed allowed. I have also tried this code and verified it works:

Anyone have any ideas why file_get_contents() is failing with an HTTPS URL?

update: People correctly pointed out this was an HTTPS issue. My webhoster claims this should work, and has no idea how to resolve this. Anyone have specific directions I can give them for their IIS7 setup?

© Stack Overflow or respective owner

Related posts about php5

Related posts about facebook-api