Xampp 上的 phpmyadmin 突然给出 403

phpmyadmin on Xampp gives suddenly 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>

知道出了什么问题吗?

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

此外,它表示在尝试访问错误页面时遇到了 403 错误(权限被拒绝)。所以显示 403 可能不是真正的错误,而是最后一个错误。

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

转到

C:\xampp\apache\conf\extra\httpd-xampp.conf

然后转到如下目录标签:

<Directory "C:/xampp/phpMyAdmin">

然后在目录标签中更改如下:

来自

Require local

Require all granted

Restart the Xampp

就是这样!