Page 1 of 1

No $_SERVER["HTTPS"] available

PostPosted: 17. June 2006 13:11
by The Dragon
Hello,

since I installed the new xampp version (1.53) the server variable
$_SERVER["HTTPS"] ist empty :?:
The option "LoadModule ssl_module modules/mod_ssl.so" in the httpd.conf file is set.

Greetings

The Dragon

PostPosted: 17. June 2006 13:43
by Wiedmann
How did you test this?

PostPosted: 17. June 2006 15:32
by The Dragon
my testfile looks like this:
<?php
echo $_SERVER["HTTPS"];
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
?>


I have a loginpage from which I redirect to https://mypage if the site is not called via https.
if($_SERVER["HTTPS"]!='on')
{
$url='https://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
echo '<h1>Sie werden auf eine sichere Verbindung umgeleitet, bitte akzeptieren sie das Zertifikat</h1>';
echo '<meta http-equiv="refresh" content="0 URL='.$url.'">';
}

If the HTTPS-variable is empty, the redirect fails. I suppose the SSL-Support is not included in the correct way, although phpinfo says SSL-Support is enabled?

PostPosted: 17. June 2006 19:15
by Wiedmann
my testfile looks like this:
Code: Select all
<?php
   echo $_SERVER["HTTPS"];
   echo '<pre>';
   print_r($_SERVER);
   echo '</pre>';
?>

And you access this script via HTTPS (eg: "https://localhost/test.php") and there is nothing in "$_SERVER['HTTPS']"?