Jump to content

Recommended Posts

I know this probably isn't the right forum to ask this, but I am desperate.  I use WAMP and it's been working fine on my Vista computer for over a year now. Today, I was working with localhost and seeing my code show up fine, but then all of the sudden, localhost stopped working (i.e. IE could no longer connect to localhost).  I didn't do anything.  It just stopped working out of nowhere.  Now I can't connect to Localhost so I can't do any PHP testing.

I shut down and rebooted but still, it won't connect to Localhost. 

Does anyone have any ideas of what could have caused this or what I coud check?  I'm freaking out over here! ???

Hi dude dont freak,

 

Check in your hosts file to see if there is a entry like this:

127.0.0.1      localhost

if there is a # before it like this

# 127.0.0.1      localhost

delete the hash as that is a comment

 

you will find your host file at:

C:\Windows\System32\drivers\etc

 

open with notepad

This is what I see when I go there???

 

# Copyright © 1993-2006 Microsoft Corp.

#

# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.

#

# This file contains the mappings of IP addresses to host names. Each

# entry should be kept on an individual line. The IP address should

# be placed in the first column followed by the corresponding host name.

# The IP address and the host name should be separated by at least one

# space.

#

# Additionally, comments (such as these) may be inserted on individual

# lines or following the machine name denoted by a '#' symbol.

#

# For example:

#

#      102.54.94.97    rhino.acme.com          # source server

#      38.25.63.10    x.acme.com              # x client host

 

 

::1            localhost

 

It should be

 

127.0.0.1        localhost

 

You need to add that to the hosts file save it then goto Start > Run  type "gpupdate /force" (without quotes) Then try to goto localhost via IE.

 

Alternatively you can use 127.0.0.1 instead of localhost to access your server.

It didn't let me save the "hosts" file at first but I changed the security settings for my user to allow me "full control" and then it let me save the hosts file with...

 

127.0.0.1        localhost

 

I then put "gpupdate /force" into the start >> run menu and it did something in the dos prompt and said "successfully updated".  Then I tried localhost again in IE and it still didn't work.

 

Going to 127.0.0.1 DOES work (like you said) so I guess I'll just have to use that.  So weird that something changed for no apparent reason and I cant get to "localhost" via IE anymore.  Oh well, if you have any more ideas, I'm all ears.

I stand corrected.  It now works (must  have been a slight delay for some reason).  Anyone, thanks so much for all your help. This site is incredible.  I always get the help I need.  And trust me, I click lots of the ads as a thank you  ;)  (and I promise I will donate sometime soon once I'm not so cash-strapped)

Thanks again.

UPDATE:  Just saw your post about the possible virus or Trojan. I will definitely check into that, thanks!

It should be

 

127.0.0.1        localhost

 

You need to add that to the hosts file save it then goto Start > Run  type "gpupdate /force" (without quotes) Then try to goto localhost via IE.

 

Alternatively you can use 127.0.0.1 instead of localhost to access your server.

 

 

What does group policy have to do with DNS resolution?  Never heard that one before x.x.

 

ipconfig /flushdns might be useful, but never knew there was a relationship between group policy and DNS stuff.

 

 

Did the localhost entry somehow get deleted again?  I wonder if WAMP is involved, because this is the third thread I've seen where the hosts file has magically gotten changed.

might help? http://support.microsoft.com/kb/300684

Use Group Policy
Using Group Policy, enable the Update Top Level Domain Zones policy under the ComputerConfiguration\AdministrativeTemplates\Network\DNS Client folder on the root domain container in Users and Computers, or on all organizational units (OUs) that host computer accounts for member computers and for domain controllers in the domain.

Note This policy is supported only on Windows Server 2003-based computers and on Windows XP-based computers.

To enable this policy, follow these steps on the root domain container:

   1. Click Start, click Run, type gpedit.msc, and then click OK.
   2. Under Local Computer Policy, expand Computer Configuration.
   3. Expand Administrative Templates.
   4. Expand Network.
   5. Click DNS Client.
   6. In the right pane, double-click Update Top Level Domain Zones.
   7. Click Enabled.
   8. Click Apply, and then click OK.
   9. Quit Group Policy.

For more information about how to use the Group Policy Object Editor to manage local computer policy, click the following article number to view the article in the Microsoft Knowledge Base:
307882  (http://support.microsoft.com/kb/307882/ ) How to use the Group Policy Editor to manage local computer policy in Windows XP
On Windows Server 2003-based DNS servers, make sure that root servers are not created unintentionally.

On Windows 2000-based DNS Servers, you may have to delete the root zone "." to have the DNS records correctly declared. The root zone is automatically created when the DNS Server service is installed because the DNS Server service cannot reach the root hints. This issue was corrected in Windows Server 2003.

Root servers may be created by the DCpromo Wizard. If the "." zone exists, a root server has been created. For name resolution to work correctly, you may have to remove this zone.
New and modified DNS policy settings for Windows Server 2003

    * The Update Top Level Domain Zones policy

      If this policy is specified, it creates a REG_DWORD UpdateTopLevelDomainZones entry under the following registry subkey:
      HKLM\Software\Policies\Microsoft\Windows NT\DNSClient
      The following are the entry values for UpdateTopLevelDomainZones:
          o Enabled (0x1). An 0x1 setting means that computers may try to update the TopLevelDomain zones. That is, if the UpdateTopLevelDomainZones setting is enabled, computers that have this policy applied send dynamic updates to any zone that is authoritative for the resource records that the computer must update, except for the root zone.
          o Disabled (0x0). An 0x0 setting means that computers may not try to update the TopLevelDomain zones. That is, if this setting is disabled, computers that have this policy applied do not send dynamic updates to the root zone or to the top-level domain zones that are authoritative for the resource records that the computer must update. If this setting is not configured, the policy is not applied to any computers, and computers use their local configuration.

@corbin its not just wamp, alot of the windows updates simply replace the hosts file, for example the very first update for office 07 adds in an entry by replacing your hosts file with its own (i think the office one is fixed now but you get the idea)

Hi

 

I had exactly the same problem yesterday. WAMP suddenly stopped serving pages from localhost (at about 9pm UK time), and it was also solved by editing the hosts file (and rebooting).

 

I could get to localhost pages using the 127.0.0.1 IP address. If I pinged 127.0.0.1 it was fine. If I pinged localhost it gave me ::1.

 

Presume it was an update of some kind. I do use NOD anti virus on that machine and it did an update at about the same time, so maybe it updated the hosts file.

 

All the best

 

Keith

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.