Author: nathan
Description:
I receive this error when I navigate to various pages in my own MediaWiki:
Notice: Undefined index: REQUEST_URI in includes\WebRequest.php on line 276
(I think it only occurs when I view Special pages).
I just uploaded the wiki last night to a windows machine (I have no control over
the machine... it is managed by my hosting provider). I think they are running
IIS with php installed as a CGI (however, I am not positive).
I have found a solution to this error. The solution I found comes from here:
It is this:
Replace the following function (in includes/WebRequest.php, line 271:
/**
- Return the path portion of the request URI.
- @return string */
function getRequestURL() {
return $_SERVER['REQUEST_URI'];
}
With this one:
/**
- Return the path portion of the request URI.
- @return string */
function getRequestURL() {
// Work around REQUEST_URI bug under W2K/IIS/CGI/PHP
if (!isset($_SERVER['REQUEST_URI']) and isset($_SERVER['SCRIPT_NAME'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; if (isset($_SERVER['QUERY_STRING']) and !empty($_SERVER['QUERY_STRING'])) $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
return $_SERVER['REQUEST_URI'];
}
This is becaue in that IIS is not setting REQUEST_URI in the environment for PHP
under CGI mode.
Version: unspecified
Severity: normal
OS: Windows XP
Platform: PC
URL: http://www.mendozamission.com/wiki/index.php?title=Special:Whatlinkshere&target=Main_Page