file_get_contents throws an error when passed a https URL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

file_get_contents throws an error when passed a https URL

Postby mecablaze » 20. October 2008 02:21

In PHP, file_get_contents throws an error when passed a https URL. What am I doing wrong?

I am using XAMPP hosted on a Windows XP SP3 box. According to where I downloaded the package, openSSL was enable when PHP was compiled. Is there a setting in a php.ini file that I need to enable for the server to be able to speak in https? The error file_get_contents throws is as follows:

Warning: file_get_contents(https://www.cia.gov/) [function.file-get-contents]: failed to open stream: Invalid argument in C:\xampp\htdocs\index.php on line 13

Here's my script's entirety:

Code: Select all
<?php

echo file_get_contents("https://www.cia.gov/");

?>


I have tried this same exact code on my own hosting package I am paying for, which is on a remote linux shared server, and the above code works perfectly.

Thanks,
mecablaze
mecablaze
 
Posts: 1
Joined: 20. October 2008 02:13

Postby w4vy » 20. October 2008 08:43

have you uncommented ;extension=php_openssl.dll in your php.ini ?
Image
User avatar
w4vy
 
Posts: 153
Joined: 04. June 2008 09:58
Location: England


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 69 guests