bobthecow / genghis

The single-file MongoDB admin app
http://genghisapp.com
MIT License
1.45k stars 165 forks source link

windows php version change default server to 127.0.0.1 instead of localhost? #140

Open isimmons opened 11 years ago

isimmons commented 11 years ago

Hi bobthecow (love the user name).

I installed this on win 7 64bit with php 5.4 and apache 2.2. It seems to be working great accept I was getting a error trying to connect to the default localhost server. I added a server and used 127.0.0.1 and it connected correctly so removed localhost from the list of servers. I don't know why but using the IP instead of localhost seems to fix a lot of things a lot of times in windows (in general). Maybe just timing out resolving the host.

tiger-seo commented 10 years ago

+1

bobthecow commented 10 years ago

Do you have an entry for localhost in your hosts file? Does Windows 7 still have a hosts file?

tiger-seo commented 10 years ago

of course :)

isimmons commented 10 years ago

Same here. Just tried again with the latest version but see it's already changed to 127.0.0.1 so it's working.

bobthecow commented 10 years ago

That's probably because it's stored in your cookies :P

Maybe a good default would be to have it try localhost then fall back to 127.0.0.1 automatically for anyone, regardless of whether they're using windows or not?

isimmons commented 10 years ago

Doh! yep cookies.

Found the problem for my machine at least. And I'm not familiar with how this works but commenting out ::1 (IPv6) in the hosts file did the trick.

127.0.0.1     localhost
#::1             localhost

It also had my apache localhost not working which I hadn't noticed since I setup virtual hosts from the start, so I figured something must be wrong on my system. I'm pretty sure that was un-commented by default but since I'm not using IPv6 I guess there is no need for it.

Though that fallback you suggest might be helpful to avoid the issue for others.

Update: I think I'm wrong about that. Looks like both are commented out in a fresh install. Must have changed it at some point for some reason.