我是WAMP的新手,今天才安装。

设置进行得很好,localhost似乎工作,但当我试图访问phpMyAdmin我得到这个错误:

被禁止的 您没有权限访问此服务器上的/phpmyadmin/。

为什么我得到这个权限访问错误与phpMyAdmin?

我用的是Windows 7。


当前回答

在WAMP 3.1.4 x64中,我解决了更新文件C:\wamp64\alias\phpmyadmin.conf的问题:

Alias /phpmyadmin "c:/wamp64/apps/phpmyadmin4.8.3/"

<Directory "c:/wamp64/apps/phpmyadmin4.8.3/">
    Options +Indexes +FollowSymLinks +MultiViews
  AllowOverride all
  <ifDefine APACHE24>
        Require local
    </ifDefine>
    <ifDefine !APACHE24>
        Order Deny,Allow
    Deny from all
    Allow from localhost ::1 127.0.0.1
    </ifDefine>

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

:

Alias /phpmyadmin "c:/wamp64/apps/phpmyadmin4.8.3/"

<Directory "c:/wamp64/apps/phpmyadmin4.8.3/">
    Options +Indexes +FollowSymLinks +MultiViews
  AllowOverride all
    Require all granted

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

最后重新启动所有WAMP服务。

其他回答

在我的例子中,使用Wampserver 3 64bit版本3.0.0,phpmyadmin.conf文件中phpmyadmin4.5.2目录的路径是错误的。由于某种原因,apps目录在scripts目录中。所以我输入了正确的路径,如下所示。然后,您可能需要重新启动Apache并重新加载页面。

我改变了:

Alias /phpmyadmin "C:/wamp64/apps/phpmyadmin4.5.2/"

<Directory "C:/wamp64/apps/phpmyadmin4.5.2/">
    Options Indexes FollowSymLinks MultiViews
  AllowOverride all
    Require local

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

To:

Alias /phpmyadmin "C:/wamp64/scripts/apps/phpmyadmin4.5.2/"

<Directory "C:/wamp64/scripts/apps/phpmyadmin4.5.2/">
    Options Indexes FollowSymLinks MultiViews
  AllowOverride all
    Require local

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

我尝试过的一切。最后我明白了是端口变更的问题。 在httpd-vhosts。conf中给定适当的端口 如果有人遇到同样的问题,会有帮助的。

<VirtualHost *:9999>
    ServerName localhost
    DocumentRoot c:/wamp64/www
    <Directory  "c:/wamp64/www/">
        Options +Indexes +Includes +FollowSymLinks +MultiViews
        AllowOverride All 
        require all granted
    </Directory>
</VirtualHost>

只需使用127.0.0.1而不是localhost(不需要更改配置文件)。

系统:

Windows 7 wampserver2.2d-x64

如此:

http://127.0.0.1/phpmyadmin/

这一条失败了:

http://localhost/phpmyadmin/

对于Apache 2.4.2:

在httpd . conf中:

改变

Require local

to

Require all granted

在WAMP 3.1.4 x64中,我解决了更新文件C:\wamp64\alias\phpmyadmin.conf的问题:

Alias /phpmyadmin "c:/wamp64/apps/phpmyadmin4.8.3/"

<Directory "c:/wamp64/apps/phpmyadmin4.8.3/">
    Options +Indexes +FollowSymLinks +MultiViews
  AllowOverride all
  <ifDefine APACHE24>
        Require local
    </ifDefine>
    <ifDefine !APACHE24>
        Order Deny,Allow
    Deny from all
    Allow from localhost ::1 127.0.0.1
    </ifDefine>

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

:

Alias /phpmyadmin "c:/wamp64/apps/phpmyadmin4.8.3/"

<Directory "c:/wamp64/apps/phpmyadmin4.8.3/">
    Options +Indexes +FollowSymLinks +MultiViews
  AllowOverride all
    Require all granted

# To import big file you can increase values
  php_admin_value upload_max_filesize 128M
  php_admin_value post_max_size 128M
  php_admin_value max_execution_time 360
  php_admin_value max_input_time 360
</Directory>

最后重新启动所有WAMP服务。