Jump to content

Archived

This topic is now archived and is closed to further replies.

karthikeyan_coder

file_get_contents("https://somedomain.com"); not working

Recommended Posts

Hello,
      I am using  Apache/2.0.55 (Win32) PHP/5.1.2.

[code]file_get_contents("https://somedomain.com");[/code]

returns a Warning

[code][function.file-get-contents]: failed to open stream: Invalid argument in D:\wamp\www\dev\file_get_contents.php on line 6[/code]

it gets well from http. but not from https

Share this post


Link to post
Share on other sites
try to surf https://somedomain.com

does it asks you to press enter or ok or something to confirm some secure session or anything like that?

maybe that's why php can't fetch the content -- it encounters a dialog box and doesn't know what to do

that's my guess as you're saying it works fine with http

Share this post


Link to post
Share on other sites
Hello, I'm new posting here, I was having the same problem, and I've fixed it loading the openssl php extension.
[code]<?php
if (!extension_loaded('openssl')) {
    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
        dl('php_openssl.dll');
    } else {
        dl('openssl.so');
    }
}
?>[/code]

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.