Loading...
 

IisWorkarounds

Workarounds for some IIS issues


I'm not sure if this is an actual fix, or just a workaround.
So until somebody advices, here's a couple of workarounds for problems that I've encountered with running Tiki on Windows with IIS.

missing SCRIPT_FILENAME

IIS doesn't seem to have this variable.
Therefore tiki-setup.php and tiki-install.php fail.
This pretty much stops you from running even the installation.
You can create this variable yourself by copying content from SCRIPT_NAME:

$_SERVER['SCRIPT_FILENAME'] = $_SERVER['SCRIPT_NAME'];

Problems with malformed URLs

Some URIs on IIS are malformed. They get an additional slash before the '?' sign to separate parameters from the page name.
e.g. tiki-browse_image.php/?imageId=2 instead of tiki-browse_image.php?imageId=2
This issue pretty much disables the whole Galaxia engine on IIS.
It is caused by malformed information in REQUEST_URI.
You can fix this by creating your own REQUEST_URI from PATH_INFO and QUERY_STRING.

$_SERVER['REQUEST_URI']=$_SERVER['PATH_INFO'];
if (isset($_SERVER['QUERY_STRING']))
{
    $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}



Simple and effective, isn't it? biggrin

Now as this is really only a workaround, the way I use this is to put these two fixes into a separate file, e.g. bb_WindowsFixes.php, and include_once them at the beginning of tiki-setup.php and tiki-install.php

And here's how the whole fix file looks:

<?php
 $_SERVER['SCRIPT_FILENAME'] = $_SERVER['SCRIPT_NAME'];
 $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
 if (isset($_SERVER['QUERY_STRING']))
 {
    $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
 }
?>


I hope this piece of simple code will be helpful

additional comment

However one should note that this fix is valid for IIS when PHP is called in the CGI/FASTCGI mode (php.exe)

If for speed reasons PHP is called in ISAPI Mode (and you will notice the difference immediately) then there is quite another set of "server_variables" and the fix has to be altered:

CGI mode: $_SERVER['REQUEST_URI']=$_SERVER['PATH_INFO'];
ISAPI mode: $_SERVER['REQUEST_URI']=$_SERVER['URL'];

Page last modified on Tuesday 10 February 2004 19:32:25 GMT-0000

Upcoming Events

No records to display

Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.