PhpMyAdmin LocalHost Forbidden with WampServer And Windows 8

First of all, I can say, that it isn’t my new post, because I have actually posted almost similar tutorial last year about fixing this localhost forbidden problem with wampserver, click here if you want to know how I install wordpress offline using Windows 7 and wampserver.

The method in Windows 8 will be exactly the same.

The reason I renew that post is because, I actually realize to change “deny from all” to “allow from all” is risking your system since you will allow every access from every IP address to your computer.

In this tutorial, I am using Windows 8 Pro and wampserver the latest version when I write this.

Basically, when I wanted to install wordpress locally with wampserver, I can’t access localhost or PHPMyAdmin.

This is the error message, saying:

Forbidden
You don’t have permission to access / on this server.

 

Image as I wanted to access localhost:

403 forbidden localhost

403 forbidden localhost

Image as I wanted to access PHPMyAdmin

403 forbidden phpmyadmin

403 Forbidden phpmyadmin

Like I said in my video, you could of used the most easiest method, which simply typing 127.0.0.1 in your web browser to access localhost or phpmyadmin, and you will be able to do that easily.

So typing http://127.0.0.1/ will work.

If this method is satisfying you, you can stop reading right here :-) But if you wanted to fix it, and use “localhost” or sooo curious like me, you can read further.

I have tried many tips and tricks that I googled and found in wampserver, I managed to get it working, but I got another trouble, which was getting the WAMP server stays on orange color and not green, which means, it wasn’t active.

Then tried another method, and finally, after many methods, this has worked fine for me.

Things To Check If You Have PHPMyAdmin and LocalHost Forbidden Problem

1. First of all, you should check in “Programs and features” in your Control Panel, whether you have “Microsoft Visual C++ 2008 and 2010 Redistributable” installed in your PC.

Microsoft Visual C++ 2008 and 2010 Redistributable

Microsoft Visual C++ 2008 and 2010 Redistributable

2. Next is finding what Operating System type you have, is it 32-bit OS or 64-bit OS? After you know it, then you can download wampsever for your OS type in this page. You will notice you will have 32-bit or 64-bit OS options there, choose it accordingly.

32 bit or 64 bit

32-bit or 64-bit?

3. Checking your host file.  WARNING: Backup your hosts file somewhere save.

To check your hosts file, you need to open your default text editor (in my case is notepad) as administrator of your computer. Then browse your Local Disc where you installed windows, which mine called, “F” because I dual boot my system. If you don’t dual boot your PC, then it should be on C Local Disk.

Browse the hosts file in, C:\Windows\System32\Drivers\etc

Inside “etc” folder, usually you will see empty folder, choose “All Files” in the drop down menu button to see hosts file.

hosts file windows 8

hosts file inside “etc” is unseen until you select, “All Files”

Then, after choosing “All Files”, select “hosts” file, and click “Open” button.

It will open your default text editor, notepad.

Inside the notepad, after hosts file BACKUP, you should see only, 127.0.0.1 locahost line only.

If you have checked these 3 things above, and all is good, then you can start to do these following steps.

Steps How I fix this

1. Click the “W” green wampserver icon on the bottom left of your screen, scroll up, and select, “Apache” then in the right menu, click “httpd.conf” to open it.

httpd conf wampserver

httpd conf wampserver

2. In notepad, search for “127”, and you will find it, it is this line of code:

# onlineoffline tag - don't remove
Order Deny,Allow
Deny from All
Allow from 127.0.0.1

Add space, colon, colon, one. ::1

See the pic, the red highlighted one is the characters I added.

allow from line

The red highlighted characters are just added.

Click, Save.

3. Click the wampserver icon, and select, “Restart All Services” to restart wampserver.

restart all services

restart all services

4. If you want, you can check by accessing http://localhost in your web browser, and you will be able to access it, but you can’t access PHPMyAdmin, because we have to do this:

Go to the directory where you install wamp, should be in C, but mine in F, because I dualboot, so C:\wamp\alias

Inside “alias” folder, open “phpmyadmin” conf file to open it.

Same like in step 2, look for “127” or just scroll down almost at the bottom of the file, the line that says, “Allow from 127.0.0.1″ add the ” ::1” don’t forget the “space” key before the first colon.

See this added highlighted line:

phpmyadmin conf file

phpmyadmin conf added line

Save, and restart wampserver again like in step 3.

Restart your WAMP server, and go to your localhost on your browser, the PhpMyAdmin and LocalHost Forbidden on WAMP problems should be gone by now.

Share the knowledge
Share on Google+0Tweet about this on Twitter1Share on Facebook7Pin on Pinterest0Share on Reddit0Email this to someonePrint this page

Comments

  1. Jason says

    I found what I believe is a better solution:

    Change in httpd.conf.

    Listen 80
    to
    Listen 0.0.0.0:80

    http://forum.wampserver.com/read.php?2,91375,91377

    This problem was really stumping me and most people having it had a bad hosts file (mine was good). There must be some software or a particular flavor of MS redistributable distro that sets it off because Wamp was running fine on my Windows 8 machine until a couple of days ago. But the above fix enables localhost again.

    • says

      Hello Jason,

      Thanks for adding another solution, really appreciate it.

      At first, I did it, but then, I couldn’t get wamp working as I have the orange icon, which doesn’t turn to green.

      Then, I only add ::1 and it works without the orange icon.

      It can be caused by many things, that I only can recommend if the solutions I wrote, and the one you add don’t fix, I can only recommend people to visit the forum.

      Thank you for stopping by and leaving a solution!

      Kimi.

  2. says

    Thank you for another lesson associated to localhost and Windows 8. I have encountered this problem already, but leave it without a solution. The next time I will encounter the problem it will not be that difficult anymore. Thanks for your step-by-step instructions. This is really important for me these days.

  3. lynn says

    this is brilliant, never seen an instruction as mint and effective such as this. solved my problem! great job!

    • says

      Thank you for your nice words Lynn, this is so encouraging to post more useful tips. And thank you for stopping by! Cheers

      Kind regards

      Kimi.