WAMP error: Forbidden You don't have permissio

2019-01-01 04:27发布

I am new to WAMP and I have just installed it today.

The setup went well and localhost seems to work, but when I try to access phpMyAdmin I get this error:

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

Why do I get this permission access error with phpMyAdmin?

I am using Windows 7.

30条回答
闭嘴吧你
2楼-- · 2019-01-01 05:02

If you are on Windows 7 or 8 then Apache might be seeing the connections coming from "::1" which is the IPv6 equivalent of 127.0.0.1.

You can check this by looking in the Apache Access Log (reachable from the WAMP menu)

::1 - - [20/Dec/2012:21:35:04 +0000] "GET /phpmyadmin/ HTTP/1.1" 403 213

The ::1 at the start is the clients address. The 403 at the end is the Access Denied code.

The answers above will remove all restrictions and open phpmyadmin to all, but if you still want to restrict phpmyadmin to your machine only (generally a good idea) then under the line...

Allow from 127.0.0.1

..add the following:

Allow from ::1

(edit: Added suggestion from Nukeface)

查看更多
骚的不知所云
3楼-- · 2019-01-01 05:03

In my case, the problem was that the phpMyAdmin version was specified wrongly in the phpmyadmin.conf file. You may check that:

  1. Go to wamp/apps/phpmyadmin3.x.x: notice the file name - what version you are currently using?

  2. Open file wamp/alias/phpmyadmin.conf:

    Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Allow from all

Check the first line (directory "c:/wamp/apps/phpmyadmin3.x.x/") is the file name exactly the same as your actual file name.

Make sure the directory file name is absolutely correct.

查看更多
旧人旧事旧时光
4楼-- · 2019-01-01 05:06

Change the file content of c:\wamp\alias\phpmyadmin.conf to the following.

Note: You should set the Allow Directive to allow from your local machine for security purposes. The directive Allow from all is insecure and should be limited to your local machine.

<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
        Allow from all
</Directory>

Here my WAMP installation is in the c:\wamp folder. Change it according to your installation.

Previously, it was like this:

<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

Modern versions of Apache 2.2 and up will look for a IPv6 loopback instead of a IPv4 loopback (your localhost).

The real problem is that wamp is binding to an IPv6 address. The fix: just add Allow from ::1 - Tiberiu-Ionuț Stan

<Directory "c:/wamp22/apps/phpmyadmin3.5.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
    Deny from all
    Allow from localhost 127.0.0.1 ::1
</Directory>

This will allow only the local machine to access local apps for Apache.

Restart your Apache server after making these changes.

查看更多
倾城一夜雪
5楼-- · 2019-01-01 05:06

So all of these answers are basically the same one. They only address one idea: it has to be DNS related. Well, that is not the only part of this it turns out. After many changes, I was getting nowhere reading the next "same answer" hoping that it would just go my way.

What did the trick for me was to adjust my versions of Apache. I think what the deal was, is that the one of the configuration files get a path off or that the install due to IIS may have been messed up / or / or /etc. And so forcing a version change readdresses everything from your firewall to bad configurations.

In fact, when I switched back to Apache 2.4.2 it goes back to being a forbidden. And as soon as I go back to Apache 2.4.4 it comes back up. That rules out local network issues. I just wanted to point out that all of the answers here are the same and that I have been able to kill the forbidden by changing the Apache version.

查看更多
栀子花@的思念
6楼-- · 2019-01-01 05:06

replace localhost with 127.0.0.1 in your URL, worked for me.

查看更多
妖精总统
7楼-- · 2019-01-01 05:08

I had the same problem. The hosts file is corrupted! there were:

localhos 127.0.0.1

localhost 127.0.0.1

localhos 127.0.0.1
localhos 127.0.0.1

The result is that localhost is not defined.

Solution: edit the hosts file with admin rights and correct to only one entry:

localhost 127.0.0.1
查看更多
登录 后发表回答