首页 > 解决方案 > Xampp 上的 phpmyadmin 突然给出 403

问题描述

我多年来一直在使用 Xampp,但突然间我无法再访问 phpmyadmin。

我明白了

Forbidden

You don't have permission to access this resource.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Mijn xampp\phpMyAdmin\config.inc.php:

<?php
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';



/*
 * End of servers configuration
 */

?>

以及我的 httpd-xampp.conf 的相关部分:

<IfModule alias_module>
    

    Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
    <Directory "C:/xampp/phpMyAdmin">
        AllowOverride AuthConfig
        Require local
        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
        SSLRequireSSL
    </Directory>

   
</IfModule>

知道出了什么问题吗?

标签: phpmyadminxampp

解决方案


它的配置方式只允许来自本地主机(运行 xampp 的同一台计算机),因此如果您从局域网客户端尝试,您应该像这样在 alis 配置中添加一行Require ip 192.168.1.0/24(根据局域网网络进行相应编辑)。

另外,据说在尝试检查错误页面时遇到了 403 错误(权限被拒绝)。因此,显示 403 可能不是真正的错误,而是最后一个错误。

您应该查看 apache 日志以验证第一个错误


推荐阅读