2013-05-27

Run localhost on window 8

5/27/2013 09:41:00 PM Posted by Hoàng Dũng No comments

Updated - 14th April 2013: (Proper Solution)

As you might know that the post I made previously was just a way to get around this strange problem. After a long time, I've finally managed to find out the actual reason for this problem, which I want to share with all of you.


The thing is that Windows 8 is an IPV6-first Operating System and WAMP is, by default, configured to run with IPV4 only. This creates a conflict and hence we face this problem. To confirm that Windows 8 uses IPV6. Open the command prompt and type ping localhost and press the Enter key. You'll receive a reply from ::1 which is the loopback address for IPV6. 

So in order to properly tackle this problem, there's no need to follow the steps I mentioned in    my earlier post. Although my older post might have solved your problem, it isn't a proper solution. Here's what you should actually be doing.

Step # 1 - Changes in httpd.conf file

  • Goto the WAMP folder (in my case, I've installed it in my E drive) > inside it double click the bin folder > then apache > apache2.2.22 (or whatever version you have) > conf > inside this folder, you'll see a file named httpd which has a file type of CONF. Right-click on this file and open it with Notepad.
httpd file inside conf folder

  • After you've opened the httpd file in Notepad, press Ctrl + F or goto Edit > Find and search for Listen 80 text. After you find this text, just add a (hash symbol) at the start of this line to comment/or make it inactive. Then type the following text on the next line - Listen 0.0.0.0:80. Save and close this file and close Notepad.

Editing in httpd file

Step # 2 - Changes in the hosts file
  • Open Notepad again, but this time as an administrator, and open the hosts file. To do this in Windows 8, press the Window Key + W to open the Search app or alternatively, press the Window Key and directly type your search term. In this case we want to search for Notepad
Search for Notepad in Windows 8

  • After you see the Notepad application icon, right-click on it and you'll see some options at the bottom of the screen. One of them reads Run as administrator. Click on it and Notepad will run as an administrator.
How to run an app as an administrator

  • Inside Notepad, click on File > Open and go to the following location, C: > Windows > System32 > Drivers > etc. Inside this etc folder you won't probably see any file which is because the file type in the bottom-right corner is set to Text Document (.txt). Select the dropdown again and select the option of All. You'll immediately see a file named hosts. Double click on it to open it in Notepad.
Open Dialog of Notepad


  • Inside the hosts file, make sure that the line with ::1 localhost written on it is commented (by using the # symbol as explained above) and the line that has 127.0.0.1 localhost is uncommented (in simple words it should not have # sign at the start of the line). Save and close this file as well as Notepad. 
Editing in hosts file using Notepad
Step # 3 (Final Step) - Restart WAMP
  • I don't think this needs any explaination. But I'll explain it anyway. Click on the WAMP system tray icon at the bottom-right of the screen and select the Restart All Services option. That's it. You're done.

Restart WAMP

After restarting WAMP, open your browser of choice and type localhost. And there you go. As for the phpmyadmin, don't worry, just type localhost/phpmyadmin and yes it works too. 

Well I hope that this method will work for all of you guys because this time we've actually handled this problem the right way. I would love to see your comments about this update. See ya next time.


Older Version of this post (not a proper solution)

I've recently started using Windows 8 on my PC and was very happy because of its great new look and feel.  But it was until I tried to open WAMP Sever on my machine. 

The problem I encountered was that WAMP's icon wasn't becoming green. Rather than that, it got stuck as an orange icon.


WAMP Server's Orange Icon  not turning Green

When I was using Windows 7,  I found out that this only happens whenever some other service or software is using our computer's Port 80 (HTTP port) and mostly it was Skype because of which I wasn't able to run WAMP properly.

On Windows 8 however, I wasn't able to find any solution to this problem. But then I came across a blog where someone had posted a solution for this, which I thought I should share with others as well. Here it is.

1. Left click on the WAMP Server system tray icon, then goto Apache > Service > Test port 80.

Checking which service is using Port 80

When you'll click on the Test Port 80 option, you'll see a cmd line screen that will display the name of the service that is using Port 80.  See the screenshot below:



Screen displaying information about Port 80


By doing this, you'll get to know which service (if any) is using Port 80. In Windows 8, by default, IIS 8 Server uses this port. When we install Windows 8, IIS 8 is also installed with it and unfortunately it automatically runs at the startupSo the only way we can make WAMP server run properly, is by Disabling this IIS 8 server.

How to Disable IIS 8 Server 


1. Open the Control Panel by Right clicking on the bottom-left corner of the screen and select the option of Control Panel. Refer to the screenshot below:

Open Control Panel (Windows 8)

2. In the Control Panel window, search for administrative tools and click on the resultant Administrative Tools icon.

Search for Administrative Tools in Control Panel

3. After the Administrative Tools window is opened, double-click on Services. Another way to access the Services window is by going to Start -> Run -> and type services.msc in the run window. Click OK and the same Services window will open.

Administrative Tools Window

4. After the Services window is opened, scroll at the bottom and double-click on World Wide Web Publishing Service.

Services Window

How to view WWWPublishing Service in Services window

This step is optional and only for those who can't find World Wide Web Publishing Service in the Services window. Jump to point number 5 if you're not one of them. Anyway, here's how to solve this problem.

4a.  Open Control Panel (as explained above). 

4b. In the Control Panel window, click on Programs (refer to the screenshot below)

Control Panel window

4c. In the Programs window, click on Turn Windows features on or off under the Programs and Features heading. (refer to the screenshot below)

Programs window

4d. When you'll click on the Turn on Windows features on or off button, a small window will pop-up. It'll contain a list of Windows Features. Scroll down until you find Internet Information Services and click on the plus (+) icon to the left of it to expand it. On expanding the menu, you'll see that one of the options will be World Wide Web Services. Just click on the checkbox on the left of it and press OK button. Windows will load for sometime and it may ask you to reboot. Reboot it if you like. And you're done.

Windows Features window

Back to our main topic

5. In the World Wide Web Publishing Service window, locate the Startup type dropdown menu and select the option that says Disable and click OK.

World Wide Web Publishing Service Window

After Disabling the IIS 8 Server, restart your computer and then open WAMP server again. Hopefully it'll run properly. To make sure that no service is using Port 80, re-run the Test Port 80 window (as described above) and you'll see a screen similar to the one below:

Test Port 80 window that shows that the port is free now


How to run Localhost on Windows 8

After Port 80 is free, I tried to run localhost in my browser but I continuously received error messages as shown below:


Error Message I received even when the WAMP icon was Green


After getting the message that is shown above, I uninstalled Skype and reinstalled the latest version of WAMP Server but still I got the following message in my browser.



Forbidden error after uninstalling Skype

After spending hours and hours on trying to solve this problem, what I found out in the end was very frustrating for me. The only thing I had to do was Left-click on the WAMP Server system tray icon and click on Put Online option (as shown below). 

Select Put Online option from WAMP Server tray icon

After that, just go to your browser of choice, and type localhost in the address bar and Voila!! It works.

Finally, localhost works!!!!
But there's still one problem, even though your localhost has started working, it is possible that you won't be allowed to access phpmyadminTo get around this problem, just type127.0.0.1/phpmyadmin in your browser's address bar and hopefully it'll work.
   Anyway, that's it for today. Hope you enjoyed this post. Please comment if you have any questions/suggestions.


0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.