WordPress.org

Ready to get started?Download WordPress

Forums

2.5 Problem Fixed, Now I'm Scared (38 posts)

  1. UncleAndrew
    Member
    Posted 6 years ago #

    Hey All,

    Through a process of elimination I was able to track down a problem with my upgrade to 2.5 (running on a Windows XP Pro box and IIS out of my home). I am not a coder or skilled with scripting languages in any way shape or form, so my grasp of just what I have done is meager at best and I'm worried about potential consequences.

    After running the upgrade script I was unable to reach the admin page. I would get errors regarding "Undefined index: PATH_INFO" in wp-settings.php. I scoped out that file and noticed that there were a couple of "else" statements set up as a fix for IIS that included the PATH_INFO statement. I remarked them out and everything has since been running like a top. The block of code I remarked out was as follows:

    //	else
    //	{
    		// Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
    //		if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
    //			$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
    //		else
    //			$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
    //
    		// Append the query string if it exists and isn't null
    //		if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
    //			$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
    //		}
    //	}

    Have I found a bug in this version of WordPress, managed to fix a problem anomalous to my system, or stuck my foot in a big ol' bucket of something that may come back to bite me later? Any input from those folks who actually know what they're doing (or at least know what I'm doing) would be greatly appreciated.

    Uncle Andrew

  2. mccauleyc
    Member
    Posted 6 years ago #

    Thanks for posting this. I was going to ask about this myself, but since it's working for you I thought I'd give it a shot and what do you know.. it works like a charm! Hopefully this will be one of the areas covered in the 2.5.1 release...

  3. jpxwordpress
    Member
    Posted 6 years ago #

    Ah 2.5.1 :p...

  4. sacredpath
    Member
    Posted 6 years ago #

    I'm waiting for 2.5.87 myself.

  5. UncleAndrew
    Member
    Posted 6 years ago #

    You know, I really can't imagine what convinced me to be an "early adopter" in this particular case....I don't habitually gravitate towards the very first release of something. Perhaps it was the siren song of self-installing updates. Whatever it was, other than this one hitch it seems to be working just fine. The new Dashboard is going to take some getting used to, though....kinda fugly, IMHO.

    Uncle Andrew

  6. redredrose
    Member
    Posted 6 years ago #

    Thanks I was having the same problem--and I know next to nothing about php. blocking out that code worked for me too...

  7. Gerard70
    Member
    Posted 6 years ago #

    Yep, worked here too! Thanks for that!

  8. hitthosekeys
    Member
    Posted 6 years ago #

    THANK YOU.

    This was driving me nuts, because the error causes the page to trigger a "this page cannot be displayed" message in IE7. At least, I think this was the culprit...

  9. hitthosekeys
    Member
    Posted 6 years ago #

    Okay, now my main page comes up but all links return this error:

    “bad server response” (NSURLErrorDomain:-1011)

    That can't be good. :(

  10. ZacharyGuidry
    Member
    Posted 6 years ago #

    I commented out lines 58 through 83 of wp-settings.php and everything seems to be working for me now.

    Thanks

  11. psoderlund
    Member
    Posted 6 years ago #

    I had the same problem and actually could solve it with the fix above, but after that my NextGEN Gallery didn't work anymore so it would be nice to actually get some pointers in what should the line "PHP Notice: Undefined index: PATH_INFO in C:\Inetpub\wwwroot\wp02\wp-settings.php on line 72" contain. I'm also using IIS so obviously something is missing. Thought about "going back" to the old WordPress but the whole database update scares me to start that whole battle!!!

    Thankfull for any tips or tricks on this error.

    Cheers
    Peter

  12. redredrose
    Member
    Posted 6 years ago #

    Peter,

    I also have NextGEN Gallery and am using IIS. Blocking out the code above doesn't seem to have affected the Gallery for me. Have you upgraded the NextGEN Gallery with the latest? It was updated just after 2.5 was released.

  13. hitthosekeys
    Member
    Posted 6 years ago #

    I think I have my install of 2.5 working correctly now.

    What I did was compare the wp-settings.php files from the 2.3 install and the 2.5 install. I noticed there is a line of code in the section regarding the PATH_INFO stuff we've been discussing that is present in 2.3 but absent in 2.5. When I added it back in, my pages now load in IE7.

    This may be a better solution than commenting out the offending code.

  14. hitthosekeys
    Member
    Posted 6 years ago #

    Okay, scratch that.

    The fix above does solve the issue with IE7, but it breaks the admin dashboard (messes up the linking to edit posts, etc.)

    There is a bug ticket on how this was playing out in WP 2.3 (see below) but I haven't found anything more recent about how this is working (not working) in WP 2.5. The trac systems won't let me log in to create a new bug ticket. (Yes, I'm registered.)

    here's that bug ticket, in case any one is curious:

    http://trac.wordpress.org/ticket/5160

    Perhaps someone with success posting a bug to the trac system could just let them know that the "undefined index" error is not theoretical

  15. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Could one of you with IIS create a test.php file and run this for us?
    <?php var_dump($_SERVER); ?>

    Post that along with your IIS version number in the various problem threads you have. You can leave out the bits that seem to be giving away too much info to you.

    See, very few people run IIS, so nobody really gets to test it on that server. It's hard to know what to code because, well, IIS kinda sucks. Different versions behave differently, and nobody knows what the stupid server variables are on different versions.

    Of course, the simple fix is obvious: Switch to Apache.

  16. zTARz
    Member
    Posted 6 years ago #

    "See, very few people run IIS, so nobody really gets to test it on that server. It's hard to know what to code because, well, IIS kinda sucks. Different versions behave differently, and nobody knows what the stupid server variables are on different versions.

    Of course, the simple fix is obvious: Switch to Apache."

    I don't think glib excuses to defects in your code due to your own lack of testing are appropriate. Either you support IIS or you don't. If you do, then a bit less condescension in light of your admitted less-than-rigorous testing and the resulting coding errors might be better received.

    Just sayin'

  17. hitthosekeys
    Member
    Posted 6 years ago #

    Keep in mind that Otto42, like everybody posting on these forums, is a volunteer. We can ALL play nice.

    I have a question in to my host about what version of IIS they are running, by the way. Will report here if I learn anything useful.

    That said, for me the option of switching to Apache for this particular blog would mean dumping a host I've been with for almost and who've given me extraordinary support over that time. If this problem of the blog being AWOL in IE7 because it's on an IIS server proves unfixable, I'd rather go back to rolling my own code. I'm hoping we can find a fix, though, because I have more and more clients asking for help with their WordPress blogs and the experience of running one myself would certainly help me be a better designer.

  18. hitthosekeys
    Member
    Posted 6 years ago #

    That said, for me the option of switching to Apache for this particular blog would mean dumping a host I've been with for almost and who've given me extraordinary support over that time.

    "a host I've been with for almost 10 years" is what the above should have said. Left out the years somehow. Oy.

  19. hitthosekeys
    Member
    Posted 6 years ago #

    Okay, some info on what my particular host is running:

    "IIS 6.0 on Windows 2003 Server SP1"

    Hope that helps someone. I'm a bit out of my depth here.

  20. Root
    Member
    Posted 6 years ago #

    Long experience of WP has long driven me from the path of *early adopter*.
    And wisdom and bitter experience have taught me to never install open source php software on MS servers. It never works.

  21. redredrose
    Member
    Posted 6 years ago #

    Peter,
    I now see what you mean about the nextgen gallery: If it's "extend" within the post then it displays fine, but if it's closed within an album it does not open. I usually have it extended, so I hadn't noticed. Have you found a fix for it?
    Thanks
    Rebecca

  22. psoderlund
    Member
    Posted 5 years ago #

    Hi Rebecca,
    I think everything is working again, I actually did get some issues solved by updating the theme also (Using the dKret 3 1.6 now) and also updated the plugin from nextgen to the latest. So right now all those issues are working but I still have some issues with pictures and posts that keeps giving me a HTTP error when trying to upload into posts... I have tried the whole copy replace with newly downloaded files for the actual WordPress 2.5 but still not working on that one... but thats a whole other ball game...
    Hope that helps.
    Peter

  23. psoderlund
    Member
    Posted 5 years ago #

    To Otto42, first of all i really appriciate any help you guys can give us IIS users.
    I'm am a noob when it comes to this so when you say to create a test.php you mean just crate the file and paste your code in it and then enter that page if so you can just get access to that information (if I did it the right way) by entering this address: Address removed for security reasons.
    I'm running it on a Windows 2003 server with SP1 and IIS ver.6.0.
    At the moment I'm getting the path_info error at the bottom of my pages (using the old wp-settings.php file at the moment so not getting that error right now).
    If I use the new file (WP2.5) then my picture upload is not working (get HTTP Error) and if I use the old settings file then I get the error in the bottom of the page about the wrong path_info but then my picture upload is working. So if I mark out the lines according to Uncle Andrew the picture upload is not working again...
    So I'm kinda stuck now between choosing picture upload or error at bottom of the page (which isn't too bad if that is all it does, but can I be sure?)

    Once again thankful for any more or new input in this case...
    Cheers
    Peter

  24. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Okay, you can take that test.php file down now. Don't need it anymore.

    Two possible fixes I can see:
    1. Replace "PATH_INFO" with "ORIG_PATH_INFO" everywhere you see it there.

    or
    2. Ask your host to "enable the cgi.fix_pathinfo option for PHP in the PHP.INI file". If they do have it enabled, have them disable it. The idea here is to get the path info to be set correctly, and from what you posted, it's not being set at all.

    Either one should fix the problem. The second option is the preferred one, because lots of scripts rely on the path info variable.

  25. redredrose
    Member
    Posted 5 years ago #

    Otto42,

    The first fix was successful for me. (I tried number 2 but my host said they couldn't change the php.ini file.)

    I would change to apache to avoid these problems in the future, but unfortunately we paid for two years at our current host. Now I know better for the future!

    Thanks for your help,
    Rebecca

  26. trivialknowledge
    Member
    Posted 5 years ago #

    hitthosekeys mentioned comparing files between versions and adding in the missing line(s). Well here are the missing lines:
    Change this:

    // Some IIS + PHP configurations puts the script-name in the....
    if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
             $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
    else
             $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];

    To this:

    // Some IIS + PHP configurations puts the script-name in the
    if (empty($_SERVER['PATH_INFO']))
             $_SERVER['REQUEST_URI'] = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')) . '/';
    elseif ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
             $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
    else
             $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
  27. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    A patch has been made to prevent this "undefined index" issue starting from 2.5.1 and up.

    Bug tracking on the problem is here:
    http://trac.wordpress.org/ticket/5160

  28. halinagold
    Member
    Posted 5 years ago #

    None of the suggested fixes seems to work for me.
    I'm looking forward to 2.5.1

    Thanks

  29. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Replace this code:

    // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
    if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
    	$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
    else
    	$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];

    With this:

    // Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
    if ( isset($_SERVER['PATH_INFO']) ) {
    	if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
    		$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
    	else
    		$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
    }

    That's the current fix in 2.5.1. Dunno if it works or not yet. It'll remove the error, but whether it works is a different story. ;)

  30. psoderlund
    Member
    Posted 5 years ago #

    Hi Otto, just to tell you that your first suggestion has resolved my issue. Im actually hosting my own site and did try to change the php.ini according to your second suggestion but that was not helpfull.
    Anyways... just to say thanks and it now works fine.

    Peter

Topic Closed

This topic has been closed to new replies.

About this Topic