XAMPP and PHP file() to https

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

XAMPP and PHP file() to https

Postby matjaz » 24. December 2018 16:41

Hello friends!

I have xampp on Windows 7 for many years - everything ok but now I have unusual problem. My website was working on http just fine. From my PHP script I sometimes call other scripts for example:

$x = file("http://mywebsite.com/do_something.php");

Last week I changed my website to https:// via CloudFlare. Website still works okay but I noticed that my file() commands cannot execute anymore. Now my script wants to do this:

$x = file("https://mywebsite.com/do_something.php"); <-- notice https, not http

and file() command doesn't work. I am assuming it is problem with Windows or Apache conf that PHP now cannot use file() to https. Does anyone know how can I fix this? I am using xampp control panel 2.5.8. (many years old!) - I don't want to reinstall because it is PHP3 on that server I just want to be able to use https with file().

Thanks!
Matjaz
matjaz
 
Posts: 1
Joined: 24. December 2018 16:30
XAMPP version: n/a
Operating System: Windows 10

Re: XAMPP and PHP file() to https

Postby modoran » 31. December 2018 11:53

This is most likely due to an incorrect cerificate for 'mywebsite.com'. Use libcurl to bypass that instead.


Btw, if "mywebsite.com' is your website, this is not how file() is supposed to work, fix your script to use local files instead.
modoran
 
Posts: 4
Joined: 31. December 2018 11:49
XAMPP version: 1.2.3
Operating System: windows 10 x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 91 guests