Fixing XAMPP Localhost in Windows 7 64-bit
Posted by Haqqi in Programming Wednesday, 12 May 2010 10:33 View Comments
After trial and error, I managed to solve this problem
As a web developer, one tool that I need is local webserver. For easy setup, I choose XAMPP as the compact webserver software, because it already includes Apache (PHP Server) and MySQL Server. Based on my experience with previous OS before (Windows 7 32-bit), the problem I faced is that I couldn’t access localhost via http. What’s wrong? Because I didn’t know how that happened, I gave up with using https instead of http. For some reasons, this won’t be good to your work. But I didn’t have any other choices. But after some weeks, I didn’t know what happened and the problem was automatically fixed. I could access http://localhost again and continue to code with that address.
Several days ago, I decided to reinstall my laptop with Windows 7 64-bit, since my RAM is 4GB, which is not optimized for 32-bit operating system. Why? Because we know that 32-bit OS can only manage to approximately 3GB RAM (based on the address mapping). And another reason is the release of Ubuntu 10.04, so that I want to create a dual boot Windows 7 and Ubuntu 10.04 version 64-bit. For some reasons, I suggest that you also reinstall your OS within some periode of time.
The effect of the reinstallation, of course I had to reinstall all software inside it. Installation of the other software didn’t make any problem. I feel good with 64-bit OS, so that my laptop can run faster because all the RAM is fully used. The same problem happened as before, when installing XAMPP as local webserver. I used XAMPP 1.7.3 in my laptop. The conditions after installation are like the following points.
- I couldn’t access http://localhost from my browser
- I managed to access the localhost via https port
- I managed to access it via IP (127.0.0.1)
- When I tried to ping the localhost, it gave my PC Name but with ip “::1:” (without quotes)
What happened? From what I read from the Internet, they suggest me to resolve the IP hosts in Windows. Ok, I tried to find the hosts file that used to be in “%SYSTEM%\System32\drivers\etc”. Actually, in Windows 7 64-bit architecture, there will be 2 system folder, System32 and SysWOW64 (which belongs to the 64-bit). I tried to find in both folders, but I couldn’t find any file titled “hosts”. Not olny that, the folder “etc” didn’t exist too. Where I can change the hosts file?
After trying to search with keyword “hosts”, I managed to find other hosts file that is placed in c:\Windows\winsxs\amd64_microsoft-windows-w..nfrastructure-other_31bf3856ad364e35_6.1.7600.16385_none_6079f415110c0210\. I thought this is the hosts file in Windows 7 64-bit. But what I thought was wrong. In that file, localhost was already pointed to 127.0.0.1. And for some reasons, I add “activate.adobe.com” pointed to same IP in order to install Adobe Photoshop (just like usual “pirated” installation). But I still couldn’t access it via http port. Why?
After further searching, I found that maybe it was because of the “http.sys” Windows 7 file that also use port 80 as its service. I tried to follow the tutorial, but still can’t reach the solution. What I got from pinging localhost still the ::1:. Hm, I thought that maybe there is another real hosts file exist. But after searching using search feature in Total Commander, I couldn’t find anything.
Searching again, and I found another solution “wanna be”. And actually that is the real solution. Ok, I’ll start share it to you who faces the same problem.
Actually, Windows 7 64-bit (I don’t know whether 32-bit also or not) create another folder called Sysnative in Windows folder. The size I saw using Total Commander is E (0 bytes). I don’t know what kind of folder is it, maybe you can share to me. In that folder, there are so many folder, which are similar to the System32 folder. I tried to find hosts file in “drivers\etc“, and I managed to find that. Wow, this is the very super hidden file that can’t be find using search feature.
Yes, this is the solution of that problem. Here is the step,
- Right click and open the security properties of the file
- Click edit and choose your account (you need to be the administrator)
- Change your permissions so that you can edit it, and then close
- Open that file in any text editor
- Delete the line that includes “::1:”, and then remove the comment (#) from the line 127.0.0.1
- You can add other routes if you want, such as “activate.adobe.com” to install pirated Adobe Collection :-p
- Close that file, and run “ipconfig /flushdns” in cmd

With those solution, now I can access my localhost via http port. I hope this article can help you who face the similar problem. Feel free to leave a comment.




PERTAMAX!!!
Nice info jeh…
Gak ono PERTAMAX2an!!! Sepisan maneh, mark as spam!! wkwkwk… Selamat datang bro…
[...] Fixing XAMPP Localhost in Windows 7 64-bit | HQ's Serenity [...]
[...] Fixing XAMPP Localhost in Windows 7 64-bit | HQ's Serenity [...]
endruzhba-909…
Очень хороший сайт по по отдыху http://www.vn7.ru/, найдете там много полезного видео…
[...] Fixing XAMPP Localhost in Windows 7 64-bit | HQ's Serenity [...]
[...] Fixing XAMPP Localhost in Windows 7 64-bit | HQ's Serenity [...]
[...] Fixing XAMPP Localhost in Windows 7 64-bit | HQ's Serenity [...]
[...] Fixing XAMPP Localhost in Windows 7 64-bit | HQ's Serenity [...]
sip, mantap om. kapan2 coba yang di linux om. kapan2 mampir ya om.
udah donk… cuma konfigurasinya kok gak stabil ya. kadang-kadang bisa akses, kadang-kadang mati… sekarang aja mesti install ulang LAMPP-nya…
You are the best!!!! Thank you soooo much
[...] Fixing XAMPP Localhost in Windows 7 64-bit | HQ's Serenity [...]
Really help my problem. Thanks so much!
Hi ,
My problem is xampp not starting. I have purchased new sony vaio laptop with windows7 installed.
After installaion when i try to start xampp it will not start….what will i do ? could you help me….
Suneesh A
Were you using skype?
The one that was not started is all software in xampp or just the apache server?
bung g ada folder Sysnative trus cem mana ini??
Thanks from Spain:)
Many thanks! your my hero!