Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » RADICORE Installation Issues » Problem with IIS
Problem with IIS [message #1194] Mon, 17 December 2007 12:18 Go to next message
theos is currently offline  theos
Messages: 3
Registered: December 2007
Junior Member
First, i'm sorry my bad english.

In radicore v1.18.0 released:
fixed bug in the logon screen when run with Microsoft IIS which caused it to use HTTPS even when an HTTPS server had not been specified.

In my case, v1.18 and v1.31, the logon screen not applied css, and the next screen link to https.

My solution:
..../includes/config.inc
$_SERVER['HTTPS']="";

The reason:
In ..../includes/include.xml.php5.inc
if (!empty($_SERVER['HTTPS']))
It was always true

In manual php:
$_SERVER['HTTPS']
Set to a non-empty value if the script was queried through the HTTPS protocol.
Note that when using ISAPI with IIS, the value will be off if the request was not made through the HTTPS protocol.

Is there another solution?


Thanks and congratulation for this great work.
Re: Problem with IIS [message #1195 is a reply to message #1194] Mon, 17 December 2007 13:07 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2363
Registered: April 2006
Location: Surrey, UK
Senior Member
It is always a problem when different web servers produce different results.

I have amended the code inside initSession() so that if $_SERVER['HTTPS'] is empty it will be set to 'off', and each line which reads
if (!empty($_SERVER['HTTPS'])) {
has been changed to
if (is_True($_SERVER['HTTPS'])) {

These fixes are in the attached file, so can you try them and let me know how you get on?.


Re: Problem with IIS [message #1196 is a reply to message #1195] Mon, 17 December 2007 18:02 Go to previous messageGo to next message
theos is currently offline  theos
Messages: 3
Registered: December 2007
Junior Member
Now work ok.

Another problem,

I have radicore in 3 system:

1. IIS, path radicore E:\intranet\radicore\...
work ok

2. xp + wamp
work ok

3. IIS, path radicore C:\Inetpub\wwwroot\Intranet\radicore\...
error before logon screen

My solution:
..../includes/config.inc
$_SERVER['DOCUMENT_ROOT']="C:\Inetpub\wwwroot";

The reason:
In IIS, $_SERVER['DOCUMENT_ROOT'] is empty.

Very grateful for your quick response.

Re: Problem with IIS [message #1197 is a reply to message #1196] Mon, 17 December 2007 18:17 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2363
Registered: April 2006
Location: Surrey, UK
Senior Member
$_SERVER['DOCUMENT_ROOT'] is supposed to be defined in the server's configuration file. Does IIS not have a configuration file?

Re: Problem with IIS [message #1198 is a reply to message #1196] Tue, 18 December 2007 05:08 Go to previous messageGo to next message
theos is currently offline  theos
Messages: 3
Registered: December 2007
Junior Member
In comments of user in http://www.php.net/reserved.variables:

$_SERVER['DOCUMENT_ROOT'] *is* supported by IIS, although only when running PHP as an ISAPI module.


Two possible solutions

1.- How to get $_SERVER["DOCUMENT_ROOT"] on IIS :

1.1.-

<?php
if ( ! isset($_SERVER['DOCUMENT_ROOT'] ) )
$_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(
$_SERVER['SCRIPT_FILENAME'], 0, -strlen($_SERVER['PHP_SELF']) ) );
?>

1.2-

<?php
if(!isset($_SERVER["DOCUMENT_ROOT"]))
{$_SERVER["DOCUMENT_ROOT"]=substr($_SERVER['SCRIPT_FILENAME'] , 0 , -strlen($_SERVER['PHP_SELF'])+1 );
}
?>

2.-

You can add $_SERVER["DOCUMENT_ROOT"] to IIS by editing the Environment Variables of your Windows server (was tested on WinXP SP2).

Right click on My Computer >> Properties >> Advanced.
In the System variables click on 'New' and Type in the name field 'DOCUMENT_ROOT' and in the value field the path to your IIS document root folder.

Don't forget to restart your Windows (IIS restart won't load the new settings).

Thank you for the support
Re: Problem with IIS [message #1199 is a reply to message #1198] Tue, 18 December 2007 05:55 Go to previous message
AJM is currently offline  AJM
Messages: 2363
Registered: April 2006
Location: Surrey, UK
Senior Member
I don't think it's a good idea to use $_SERVER['PHP_SELF'] to provide a value for $_SERVER['DOCUMENT_ROOT'] as a script may be run from any subdirectory below the root directory. This would make $_SERVER['DOCUMENT_ROOT'] variable when in fact it is constant for the entire installation.

I never use any web server other than Apache (the industry standard) so I never encounter these problems.


Previous Topic: pg_connect parameter order?
Next Topic: unable to logon
Goto Forum:
  


Current Time: Fri Nov 08 21:43:58 EST 2024

Total time taken to generate the page: 0.01481 seconds