Can't connect to "localhost"

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

Can't connect to "localhost"

Postby yuyu » 19. August 2009 01:38

Dear Sir,

I have similar problems:

Though I am using Vista. My installation worked before, version 1.6.6a. And I have not used it for about a year, and coming back to it, I can not open the http://localhost/xampp/ page, the error message says:

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

I click on the apache_start.bat file, the window says:
"
Please close this command only for Shutdown
Apache 2 is starting...
(OS 10048) Normally an address can only be used once. :make_sock:
could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

Apache could not be started
press any key to continue....
"
Meanwhile the Xampp control panel shows both Apache and mysql are running.

In windows task manager, with apache_start.bat running i see 2 "apache.exe" , no "httpd.exe", one "msqld-nt.exe".

At this point, with the .bat file still running, I still can not see the http://localhost/xampp/ or the http://localhost/xampp/splash.php page.

Please help. Thanks.

I also don't understand what you meant by
It looks like you have also installed the Windows services:
- stop Apache /MySQL (if they are running with the batchfile)
- delete the services (e.g. with "sc")
- reinstall the services


yuyu
yuyu
 
Posts: 5
Joined: 19. August 2009 01:20

Re: Apache and MySQL won't start in 1.6.8 install on Win XP

Postby Izzy » 19. August 2009 02:31

yuyu wrote:...I click on the apache_start.bat file, the window says:
"
Please close this command only for Shutdown
Apache 2 is starting...
(OS 10048) Normally an address can only be used once. :make_sock:
could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

Apache could not be started
press any key to continue...."
@yuyu
Your issue may be slightly different to the one the OP has because yours relates to another server using port 80 which Apache requires exclusively.

Usually this would be Skype or Microsoft's defaults web server IIS (Internet Information Services or inetsvr) and you would need to reconfigure either or both of those servers from using port 80 if they indeed are the culprits.

yuyu wrote:I also don't understand what you meant by
It looks like you have also installed the Windows services:
- stop Apache /MySQL (if they are running with the batchfile)
- delete the services (e.g. with "sc")
- reinstall the services
sc is an acronym for Service Controller sc.exe and is actioned from a command prompt.

Here follows text from a post I made some time back which might help with understanding.
Izzy wrote:Close/Exit the control panel.

Open a command prompt
Click start
Click on Run...
Type: cmd.exe

Remove old or sticky services.
Apache
Type:
sc delete apache2.2
(or sc delete apache if an older XAMPP)
Click OK

MySQL
Type:
sc delete mysql
Click OK

Stop the running FileZilla Service before doing this next one or it will only be marked for deletion when the service is stopped or you reboot your PC.

Type services.msc then look for and stop the FileZilla Service or if available in the XCP then stop it there.
FileZilla
Type:
sc delete "FileZilla Server"
Click OK

Close the command console

Start the control panel and try install your service again by ticking the Svc box or use the *_installservice.bat files provided in the various component's directories.


BTW - sc is an acceptable abbreviation for sc.exe Windows Service Controller and will delete any stray services that won't shut down by any normal means.

Microsoft explains the Service Controller Commands here.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Apache and MySQL won't start in 1.6.8 install on Win XP

Postby yuyu » 19. August 2009 05:08

Hi Izzy,

After I submitted my last post, I tried rung the apache_start.bat file on an installation that works (it is installed on windows XP), and I got exactly the same message:

Please close this command only for Shutdown
Apache 2 is starting...
(OS 10048) Only one usage of each socket address is normally permitted. . :make_sock:
could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

Apache could not be started
press any key to continue....


I think this message means that xampp is running already, and the port 80 is being used. therefore it can not be band to the same port again?

Also, the unworking installation and the working installation have the same information in the xampp control panel and windows task manager.

I feel that the xampp is running fine, it is just the browser can not see it somehow....?

Advice?

yuyu
yuyu
 
Posts: 5
Joined: 19. August 2009 01:20

Re: Apache and MySQL won't start in 1.6.8 install on Win XP

Postby Izzy » 19. August 2009 05:33

That's correct, you can't start Apache again if it is already running.

I did read somewhere on the forums that Firefox has been an issue and when another browser was used it loaded just fine - have you another browser installed so you can test this out?

If you have and it loads fine then have a look on the Firefox forums for perhaps a configuration fix.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Apache and MySQL won't start in 1.6.8 install on Win XP

Postby Wiedmann » 19. August 2009 10:10

yuyu wrote:I can not open the http://localhost/xampp/ page, the error message says:
...
Failed to Connect
Firefox can't establish a connection to the server at localhost....
..
Meanwhile the Xampp control panel shows both Apache and mysql are running.
...
In windows task manager, with apache_start.bat running i see 2 "apache.exe"

Can you access http://127.0.0.1/xampp/?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Can't connect to "localhost"

Postby yuyu » 19. August 2009 13:08

Wow, just tried http://127.0.0.1/xampp/ and it works!

tried to access http://localhost/xampp/ from IE, it doesn't work on IE either.

So now, http://127.0.0.1/xampp/ works, what should I do to make it work for localhost? or I should irgnor localhost and use 127.0.0.1 instead?

Thanks

yuyu
yuyu
 
Posts: 5
Joined: 19. August 2009 01:20

Re: Can't connect to "localhost"

Postby Wiedmann » 19. August 2009 13:20

Wow, just tried http://127.0.0.1/xampp/ and it works!

Remove the line "::1 localhost" from your HOSTS file ("%windir%\system32\drivers\etc").
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Can't connect to "localhost"

Postby yuyu » 19. August 2009 16:57

Thanks for this.

Just tried to change the hosts file, but it wouldn't allow me. It says I don't have sufficient rights, but I am the Administrator. What can I do?

yuyu
yuyu
 
Posts: 5
Joined: 19. August 2009 01:20

Re: Can't connect to "localhost"

Postby Wiedmann » 19. August 2009 17:22

What can I do?

Read the Microsoft Knowledge Base? They have an article (kb923947) which exactly describes how to do this.
(Of course, it's always the same in Vista, if you want edit a file, but don't have enough privileges.)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Can't connect to "localhost"

Postby yuyu » 19. August 2009 21:17

That works like treat, thank you soooooooo much.

yuyu
yuyu
 
Posts: 5
Joined: 19. August 2009 01:20


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 147 guests