• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Wordpress Question...

DRE

Well-known member
#1
How come localhost doesn't work sometimes as a database server host name when installing wordpress? I've installed it before using 'localhost' but just now on someone else's site I had to use the ip address '127.0.0.1'.
 
R

ragtek

Guest
#5
How come localhost doesn't work sometimes as a database server host name when installing wordpress? I've installed it before using 'localhost' but just now on someone else's site I had to use the ip address '127.0.0.1'.
if localhost isn't set in the hosts file, it won't work and you'll have exactly the problem you've described;)

Also if your config file is damaged or you have some strange config entries, it won't work;)
@hoffi 127.0.0.1 isn't always localhost because you can manipulate it :p
eg
change it in your hosts file ( c:\windows\system32\drivers\etc\hosts or /etc/hosts )
to
Code:
212.53.128.131 localhost
#127.0.0.1      localhost
127.0.1.1      bt.foo.org      bt
 
# The following lines are desirable for IPv6 capable hosts
::1    localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
and check localhost in your browser or check the ip via ping or run a trace to see where "YOUR LOCALHOST" is ;)
 

DRE

Well-known member
#6
if localhost isn't set in the hosts file, it won't work and you'll have exactly the problem you've described;)

Also if your config file is damaged or you have some strange config entries, it won't work;)
@hoffi 127.0.0.1 isn't always localhost because you can manipulate it :p
eg
change it in your hosts file ( c:\windows\system32\drivers\etc\hosts or /etc/hosts )
to
Code:
212.53.128.131 localhost
#127.0.0.1      localhost
127.0.1.1      bt.foo.org      bt
 
# The following lines are desirable for IPv6 capable hosts
::1    localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
and check localhost in your browser or check the ip via ping or run a trace to see where "YOUR LOCALHOST" is ;)
Thanks but it's in there. The host file on my computer or browser isn't the problem.
 

Hoffi

Well-known member
#7
Ah, ragtek, No Professionell changes this. The complete 127.x.x.x subnet is reserved for localhost. Normally 127.3.4.5 should also work.