WordPress 2.5 Error on Windows IIS:Undefined index: PATH_INFO

After upgrading to WordPress version 2.5 on Windows IIS,you may get the following errors:

Notice: Undefined index: PATH_INFO in (path)\wp-settings.php on line 74
Notice: Undefined index: PATH_INFO in (path)\wp-settings.php on line 77 

to solve this problem,open file wp-settings.php,goto line 71 and replace the following code:

if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
	$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
else
	$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];

with:

if (empty($_SERVER['PATH_INFO']))
	$_SERVER['REQUEST_URI'] = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')) . '/';
else if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
	$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
else
	$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];

this will resolve that issue,Your can also download an already modified version of wp-setting.php from here.

Related posts:

TAGS: , , , ,


4 Comments »

Alan On August 2nd, 2010 at 10:08 pm (#)

thank you, i cannot though get it to work. here is my code:
$addition     = explode($path,$_SERVER['REQUEST_URI']);
and also:
$cPage = ($path == '/' ? '' : $path).$_SERVER['REQUEST_URI'];
The page with the error is here:
http://www.dnaclothing.co.za/shop/index.php/leisure/jerseys/mens-status-jersey

i appreciate your help.

shuigji On March 25th, 2009 at 7:59 pm (#)

go!http://www.dubozuobi.com

ZishiciarsE On October 7th, 2008 at 8:46 am (#)

favorited this one, bro

mikelorie.com » Blog Archive » Test po On May 20th, 2008 at 12:36 pm (#)

[...] trying to finish a book. What I was getting were ‘undefined index’ errors; thanks to deanlee.com for the quick fix. And, of course, there were settings to change. Rereklamo kasi [...]


Leave a comment


(will not be published)