Can't connect to localhost

drdeutsch

2[H]4U
Joined
Sep 17, 2004
Messages
3,775
I was setting up Wampsever to mess around/learn PHP. Got it all configured and could not connect to localhost or PHPMyAdmin in Firefox or IE. Started reading around and trying lots of thing.

Uninstalled Nod32
Played with Windows Firewall (disabling, adding exceptions)
Reset router settings
Installed/uninstalled IIS
Started/stopped services
Checked HOSTS file

I can PING localhost in a command window. No problems there.
When I go to http://localhost or http://127.0.0.1 however, I only get a blank page in Firefox or a "Page not found" in IE.

I'm probably missing something insanely easy, so help me out here. Not being able to do this means I can't use WAMP and learn PHP.
 
open a command line and type 'netstat -an' and make sure you're listening on tcp port 80 for localhost. if not, the service isn't running.

it should look something like this (taken from a linux server)

Code:
Proto   Recv-Q   Send-Q   Local Address    Foreign Address    State
tcp          0        0   0.0.0.0:80       0.0.0.0:*          LISTEN
 
That's exactly what I get: TCP 127.0.0.1:80 LISTENING

For now I've uninstalled Wampserver and IIS and everything else. I figure if I can't get localhost then there's no point in having those installed.

I'm still getting a blank page on FF and a "Page not found" in IE.
Could this be an ISP issue? I live in Taiwan and use Changhwa DSL, which basically everyone does - it's like the National telephone/cable/internet company.
 
no, it's not an ISP issue. connecting to localhost never leaves your computer. however, just to try, instead of connecting to http://localhost try http://127.0.0.1

if that works, no one else will be able to connect to you because you may not be listening on your actual NIC IP. you either need a listening on 0.0.0.0:80 or a separate line for every IP on your computer.

also if you can connect to 127.0.0.1, but not localhost, you need to add that to your hosts file. i think it's something like windows\system32\drivers\etc\hosts. that file should have a line that defines localhost as the 127.0.0.1 IP, which should be there by default anyway.
 
oh, and i just realized you uninstalled your web server. in order to connect, you still have to have the web server software installed and running.
 
Back
Top