Jump to content

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


karthikeyan_coder

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
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
  • 2 months later...
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]

Archived

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

×
×
  • 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.