Cannot install XAMPP as something already exists

8,118

Maybe, some spyware or adware modified the hosts file in order to redirect localhost to some custom URI/IP. You can find the file here:

%SystemRoot%\system32\drivers\etc\Hosts

The file shouldn't be very large, in fact, it's only about 20 lines long (incl. comments) in the default version.

If you have a XAMPP installation on your PC, you can also quickly test whether another program is listening on port 80:

  • Open XAMPP Control Panel
  • Click on "Netstat"
  • Look for a table entry with the port number 80
Share:
8,118

Related videos on Youtube

Gerald
Author by

Gerald

Updated on September 18, 2022

Comments

  • Gerald
    Gerald almost 2 years

    I was trying to install XAMPP on a friend’s Windows 7 laptop. First, it gave me the error message that it could not install to C:\xampp as the folder was not empty. I had a look at the folder and it contains the following subfolders:

    • apache
    • mailoutput
    • mailtodisk
    • mysql
    • php
    • tmp

    So, I thought to myself, maybe XAMPP is already installed. I checked http://localhost, and it gave me a page full of ads, which isn’t normal for XAMPP. In fact http://localhost/ANYTHING gives me a page full of ads. Viewing source on that page gives a complete blank. I do not understand how that is possible.

    I asked my friend, whose laptop it is, and she has vague recollections of installing some sort of WAMP server from a USB stick. I tried renaming C:\xampp as C:\_xampp, but the existing localhost is unaffected. I looked through the list of programs in Control Panel > Remove Programs, but couldn’t see any reference to Apache, XAMPP, PHP. or anything with a similar name. There is a program called “MySQL Installer”, but that’s probably not relevant.

    How can I find and remove the existing webserver, so I can replace it with XAMPP?

    • Gerald
      Gerald over 10 years
      Problem 1: the ads aren't coming from the localhost: they're coming from an infection in her browser. She has something which is injecting ads into pages. We'll have to fix that first, then I'll rewrite this question.
  • Gerald
    Gerald over 10 years
    Everything in the hosts file was comments. There was a comment that localhost resolution was handled within DNS itself, and then two localhost entries (127.0.0.1 and ::1) commented out. Nothing malicious. I've uncommented those last two. It made no difference. Still getting ads. Shall try installing XAMPP again and following your next suggestions.
  • ComFreek
    ComFreek over 10 years
    @TRiG The last two are safe (I have them, too). Please check whether any other program is listening locally on port 80 (just use the XAMPP Control Panel from your old XAMPP installation).