We help IT Professionals succeed at work.

Xampp started no localhost

handsun123
handsun123 used Ask the Experts™
on
I have installed xampp and used it for several tasks so I know the installation should be good. I started it and mySQL from the xampp control panel, both show as running,firewall allowing xampp, but when I browse to http://localhost I get this:
       Unable to connect
Firefox can't establish a connection to the server at localhost. I am a newbie at this any advice?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
Make sure Apache is started.  It's the program and service that 'answers' at 'localhost'.

Commented:
What port did you install Apache to?

Try:

http://localhost:8080

Does your windows host file have the correct info?

C:\WINDOWS\system32\drivers\etc\hosts

Does it have the line:

127.0.0.1       localhost

Are you running anything else on port 80? Skype for example.
Hello!
 XAMPP sometimes behaves oddly and shows that it's started when it's not and the
other way around. It sometimes starts and crashes immediately,so after starting it,you should check if there is a process called Apache.exe in the Task Scheduler's Process Tab.
Next,if it is there,and still no connection,you should type:
netstat -ab
 to show all open ports and the executables that are listening on those ports. On ports 80 (http) and 443 (https) the executables should be Apache.exe.
If it is not,there might be other applications that are using port 80 (Skype made problems for my colleague, and I run into a windows service called Web Publishing Service which I had to turn off). You should turn such possible culprits and run netstat again to see if it is working.
You can also make XAMPP listen on other port, for instance 3333, by changing the value in httpd.conf:Listen 80
to:Listen 3333
and you would access your root directory by:
http://localhost:3333/
And yes,you might try typing:
http://127.0.0.1/
instead of
http://localhost/


Author

Commented:
I ran port check from Xampp control panel and its port 80, I checked the skype port and I had already disable the "run port 80 "option, it says use port  38526 for incoming connections, the hosts file reads
localhost name resolution is handled within DNS itself.
#      127.0.0.1       localhost
#      ::1             localhost
apache is started, I meant to say that , I started it from the xampp control panel, it still says running, I tried the apache start bat and it says apache already running, but I cannot see it in process tab of task manager I do see xampp and mysql
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
Disabling port 80 means you can't use a connection like "http://localhost/", you have to use "http://localhost:38526/".  That will make it difficult to use a lot of things that expect port 80 to be the webserver.

Author

Commented:
No that was the skype disable for port 80
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
the hosts file reads localhost name resolution is handled within DNS itself.
#      127.0.0.1       localhost
#      ::1             localhost

Did you make that change?  DNS as far as I know Can't handle 'localhost' because 'localhost' isn't supposed to go out on the network.  The 'hosts' file is where it is defined.

Author

Commented:
I did not make that change, I got this laptop from someone else. I have run a perl script in the past on this setup by starting apache, and I just tried it again and the perl runs, so apache must be running right? per.l exe shows up in task manager, but apache.exe does not.
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
Perl doesn't explicitly require Apache except to run as CGI.  Perl works fine from the command line as does PHP if it is configured for that.  Look in task manager for 'xampp' or some variation of it.  WAMP shows up as 'wampmanager' and not Apache.  Which browser are you using?  What operating system?
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
You need to change your hosts file like below.
127.0.0.1       localhost
::1             localhost

Open in new window

Author

Commented:
I opened notepad as an administrator and I removed the # (hash sign) which was in front of the code, now it reads:
127.0.0.1       localhost
::1             localhost

Then I stopped apache and mySQL from the xampp control panel and started them again, this is what I got in Firefox, I am running Windows 7 and I APPRECIATE your help Dave, I also first completely disabled my firewall ,  thanks, Carin  

Firefox can't establish a connection to the server at localhost.


    *   The site could be temporarily unavailable or too busy. Try again in a few
          moments.

    *   If you are unable to load any pages, check your computer's network
          connection.

    *   If your computer or network is protected by a firewall or proxy, make sure
          that Firefox is permitted to access the Web.
Fixer of Problems
Most Valuable Expert 2014
Commented:
I suggest you save any work in the 'xampp' directories to another place.  Then uninstall XAMPP, reboot, and re-install it.  I think it may have been installed incorrectly with the hosts file wrong.  I've only used it on XP but it came up working immediately.

Author

Commented:
Thanks so much

Author

Commented:
That was it Dave!
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
Thanks, glad to help.