14

On a fresh install of Windows 7 and Xampp I am unable to access localhost. It just says not found even though Apache and MySQL are running just fine. What I tried so far:

  • check the hosts file for this line: 127.0.0.1 localhost
  • check Skype (removed it completely).
  • checked for anything else like Skype that could have caused a problem
  • turned off virus scanner and firewall

I'm lost here, does anyone has a clue what the problem could be?

[EDIT]

I figured out the problem. For some reason Apache was using port 85 instead of 80. I changed Listen 85 to Listen 80 in the config file from Apache. All is good now.

andr
  • 15,970
  • 10
  • 45
  • 59
Prd87
  • 315
  • 1
  • 3
  • 9
  • how you know that apache and mysql are running just fine ?? – 000 Jul 28 '12 at 14:39
  • Control panel from xampp says they are running and i'm not getting any errors :x – Prd87 Jul 28 '12 at 14:47
  • have you turned off windows default firewall also ?? – 000 Jul 28 '12 at 14:55
  • Yes thats the only firewall I use – Prd87 Jul 28 '12 at 16:02
  • Try using http://127.0.0.1 instead of localhost Also go through all answers for this post http://stackoverflow.com/questions/7665330/xampp-not-working-on-windows-7-windows-7-forums may be something will help – 000 Jul 28 '12 at 16:13
  • Add ::1 localhost also to your hosts file in addition to 127.0.0.1 localhost. The former one is ipv6 convention – 000 Jul 28 '12 at 16:20
  • Thanks for your suggestions. This was not the problem however. I did find the solution, see my edited post. – Prd87 Jul 28 '12 at 17:09
  • 2
    you may post your edit part as an answer so that future visitors may get benefited.. – 000 Nov 24 '12 at 11:38
  • teamviewer also uses port 80, uninstalling teamviewer solved my problem – vikas etagi Nov 15 '17 at 04:32

5 Answers5

21

i faced the same problem. opening the localhost with specific port number is what resolves the problem. in my case i had changed the listen port to 8081 from default 80. So browsing http://localhost:8081 works well for me. Hope it helps.

Dev
  • 319
  • 2
  • 4
  • Why in my previous XAMPP it was OK and it opened `locallhost` without any port number automatically but now we should add port number or type `127.0.0.1` instead of `localhost`? Do you know how to change its setting such that it opens the right port automatically and not by typing? – C.F.G Sep 10 '22 at 11:24
2

I found the solution for this problem. Normally because of applications like Skype and VMware, we change the listening port of Apache from 80 to 81 or some other.

Then after starting apache, go to the web browser and type in localhost:XX

eg: if the port is 81, type in

localhost:81

Keet Sugathadasa
  • 11,595
  • 6
  • 65
  • 80
2

Possible reason: A program is running with port 80!

Run XAMPP (=> Apache) under an another port:

Rename all ports with 80 to 8080 in your httpd.conf file.

Your using Windows: Use notpad or editor with Ctrl+H to replace "80".

Well you correct it now to port 85. ;-)

Suriyaa
  • 2,222
  • 2
  • 25
  • 44
1

when you run Xampp, check the apache port no. ex: if it is displaying port 80, then type http://localhost:80/phpmyadmin/

Manibala Sinha
  • 127
  • 1
  • 3
0

I have faced the same problem. Xampp runs in port 80,443 by default and MySQL at 3306 There may be any other process running on the same port.

  • You cannot run MySQL and XAMPP at the same time. (or MAMP)

  • If you have Skype, kill the skype through the task manager

  • Check which processes are running through port 3306

    Commands for your help

netstat -ano | find "3306" taskkill /PID typeyourPIDhere /F

It may seem silly but check whether you started apache server before starting MySQL. Apache should be in run to open MySQL in localhost.