Localhost does not work

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Localhost does not work

Postby jobs » 10. March 2009 03:26

Hi all, I am really new to this, but I have spent about an hour reading and searching this forum. But I have not had any luck finding an answer. I'm running Vista. I installed Apache, MYSQL, PHP over the weekend and all was working. I was able to access http://localhost/mysite.php w/o any problems. I come home tonight and I cannot access localhost. I CAN access 127.0.0.1/mysite.php. I have tried changing listen 80 to *:80 in httpd.conf. I cannot get Apache to stop. Continues to give my busy... -1 error. Same for MYSQL..busy. I have not tried reinstalling Apache. I have cleaned IE cache.
So, when I type http://localhost, I get IE cannot display this page. When I type http://127.0.0.1 it display XAMPP for Windows page. Please, any ideas? Thanks!!
jobs
 
Posts: 5
Joined: 10. March 2009 02:35

Re: Localhost does not work

Postby Izzy » 10. March 2009 03:32

jobs wrote:So, when I type http://localhost, I get IE cannot display this page. When I type http://127.0.0.1 it display XAMPP for Windows page. Please, any ideas? Thanks!!
Go to C:\Windows\system32\drivers\etc\ and drag the hosts file into your open text editor and find this line:
::1 localhost
comment out the line so it looks like this:
# ::1 localhost

Save the file, clear your browser's cache again and then try once again to go to http://localhost
Last edited by Izzy on 12. March 2009 07:49, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Localhost does not work

Postby jobs » 10. March 2009 03:46

Thanks. I did exact as stated, but my editor will not let me save file. "Check whether if this file is opened in another program". I rebooted and immediately tried again with same msg. I disabled winMySQLadmin in msconfig and tried again after rebooting. Will not let me save file. Thanks... ?
jobs
 
Posts: 5
Joined: 10. March 2009 02:35

Re: Localhost does not work

Postby abandonwareguru » 10. March 2009 04:09

In Vista, you'll have to disable UAC or move the file to an unprotected location first, as X:\Windows\ and all subdirectories are protected and cannot be edited otherwise. Simply move the file to your desktop first, or disable UAC.
abandonwareguru
 
Posts: 5
Joined: 10. March 2009 01:58

Re: Localhost does not work

Postby jobs » 10. March 2009 04:18

thanks!!!
what caused localhost to stop working in the first place?
jobs
 
Posts: 5
Joined: 10. March 2009 02:35

Re: Localhost does not work

Postby Izzy » 10. March 2009 04:22

Make sure UAC is disabled and you are logged in as an administrator in Vista.

Or run Notepad as Administrator. Find the shortcut for Notepad in your Programs list, right-click on it and choose "run as Administrator".

Now do File>Open to get the Hosts file. Make your changes and you should be able to save it.



Is localhost working now?
Last edited by Izzy on 12. March 2009 07:52, edited 2 times in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Localhost does not work

Postby jobs » 10. March 2009 04:24

Yes, it is! thanks a lot. Just curious (I'm learning here), why did localhost work for 2 days and then stop? What changed? Was this line commented out when I first installed apache?
jobs
 
Posts: 5
Joined: 10. March 2009 02:35

Re: Localhost does not work

Postby Izzy » 10. March 2009 04:28

No, the line was not commented out when you installed XAMPP.

Did you reboot your PC in between installing and noticing the error, else I have no idea as I can't know what else may have taken place in between installation of XAMPP and you having issues?
Last edited by Izzy on 12. March 2009 07:54, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Localhost does not work

Postby jobs » 10. March 2009 04:37

No, but I did put it in hibernation last night. When I returned today, localhost would not work! Thanks for your help.
jobs
 
Posts: 5
Joined: 10. March 2009 02:35

Re: Localhost does not work

Postby Izzy » 10. March 2009 04:45

Your welcome and yes hibernation would have caused it as when the system comes out of hibernation there is a check carried out much like a mini reboot if you will which would have introduced the Hosts file again in the equation of the Apache startup sequence.
Last edited by Izzy on 12. March 2009 07:56, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Localhost does not work

Postby jlross » 11. March 2009 17:01

No proof...

But, I am of the mind that some M$ hotfix may have "fixed" us all based on what we see on the forums right now and based on the fact that "updates" are the only changes I've made in the last week to any of my PCs.

I've had XAMPP installed on both my systems for about a year now. My Vista install suddenly stopped working this week while my XP Pro install is still just fine. (I use both practically daily anymore.) I thought maybe a fresh install to 1.7 from 1.6.8 would do the trick - no joy. The fix in this post was the only thing that worked and I, too, am an incredibly curious person as to WHY this works and what, exactly, happened to foul things up in the first place. (When in doubt, blame Bill Gates - or whomever runs the company now - I guess. LOL)

Right now as it is I still have to restart MySQL every time I boot my Vista box to get my local Joomla sites to load. So, something clearly still isn't right. I know when I do a port scan on my Vista box it just shows "SYSTEM" is using the various ports instead of actually listing the XAMPP file location using the port(s) the way it does on my XP box. If I open the XAMPP control panel it doesn't have the green "Running" next to MySQL either (even when it is running and working fine).
jlross
 
Posts: 1
Joined: 09. March 2009 22:59

Re: Localhost does not work

Postby SomeFunkyDude » 12. March 2009 15:43

first off.... let me start by saying izzy, you sir are a GENIUS!

I was having the exact same problem, xampp would stopped working for localhost
I've been running xampp for a long time and have used hibernation mode before, so I don't think it was that, I did notice Microsoft installed several updates on my computer recently, so it must have been that. I was about ready to cry, how can I build websites if I don't have a local testing environment.. I tried reinstalling xampp, disabling, enabling firewalls, UAC, etc.

Did exactly as you said, commented out the ::1 localhost with a #, and furthermore, had to run notepad++ as an administrator to save the host file.

Thanks!
SomeFunkyDude
 
Posts: 1
Joined: 12. March 2009 15:37

Re: Localhost does not work

Postby jprogrammer » 13. March 2009 08:51

jlross wrote:No proof...

But, I am of the mind that some M$ hotfix may have "fixed" us all based on what we see on the forums right now and based on the fact that "updates" are the only changes I've made in the last week to any of my PCs.


Jl,

I have the same problem. After I installed the updates my xampp stopped working. I thought that maybe that apache for some reason was corrupted. So I tried debugging with nusphere phped and it's internal server. Same problem. Tried reinstalling xampp but the problem still exists, so tried installing zend community server and still same problem. I am going to try the fix on here in a minute.

I am feeling it is pointless to keep updating my windows because of stupid problems like this. Last year my dell inspirion laptop went into sleep mode and would only wake up intermittently. At first it would take about 20 restarts before I got it to wake up. Each time it would try to wake up but then do nothing. That happend for a couple of days. I contacted tell and they told me that I needed to update my windows as the problem was dealt with in one of their latest patches. THen about the 3rd day my laptop would not start for about 6 hours. I finally went out and bought a new laptop. :( 2 more days later my dell started up. I rolled back all the fixes that had been applied just before the incident and man my laptop was humming along just like before. Since then I have turned off any auto updating. Till this day my laptop has been humming along just fine till recently when I installed the latest updates.

So for now I will be very hesitant on updating my windows. I really need this laptop for my work and windows updating has cost me too much downtime on my work.

Jeff
jprogrammer
 
Posts: 1
Joined: 13. March 2009 08:37

Re: Localhost does not work

Postby isamar » 15. March 2011 17:40

Hello,

i did everything right and finally the message changed! BUT... now it appears to me:

Forbidden

You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


Why should this be?? I'm logged as administrator and the XAMPP says status Check Ok... Probably this is really simple, and i'm just a little dummy, but can someone please help me?

Going grazy :/ Thx
isamar
 
Posts: 1
Joined: 15. March 2011 17:33

Re: Localhost does not work

Postby Sharley » 15. March 2011 23:10

@isamar
Read the \xampp\apache\logs\error.log file for better clues about any server related errors.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3


Return to XAMPP for Windows

Who is online

Users browsing this forum: Bonniem and 68 guests