在 Ubuntu 12.04 上安装 Lampp(XAMPP for Linux 1.8.1)后,我无法访问 phpmyadmin

在 Ubuntu 12.04 上安装 Lampp(XAMPP for Linux 1.8.1)后,我无法访问 phpmyadmin

我在尝试打开 phpmyadmin 时看到此错误(http://127.0.0.1/phpmyadmin) :

`New XAMPP security concept:

 Access to the requested object is only available from the local network.
 This setting can be configured in the file "httpd-xampp.conf".

 If you think this is a server error, please contact the webmaster.

 Error 403
 xser.com
 Apache/2.4.3 (Unix) OpenSSL/1.0.1c PHP/5.4.7`

编辑:

我已经在“httpd-xampp.conf”中注释掉了这段代码,但是它又引入了新的问题。

# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|#server-status|server-info))">
    Order deny,allow
    Deny from all
    Allow from ::1 127.0.0.0/8 \
        fc00::/7 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 \
        fe80::/10 169.254.0.0/16

    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>

现在我看到了——

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403

xser.com
Apache/2.4.3 (Unix) OpenSSL/1.0.1c PHP/5.4.7

答案1

您需要将此行(“要求全部授予”)添加到 httpd-xampp.conf 文件的<Directory "/opt/lampp/phpmyadmin">部分。

以下是具体变化:

# since XAMPP 1.4.3
<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny
    Require all granted
    Allow from all
</Directory>

答案2

只需输入sudo /opt/lampp/lampp security 并设置 phpmyadmin 的密码,然后以用户名 - lampp 密码 - your_given_password 登录 phpmyadmin

答案3

在 XAMPP 1.8.1 中,你必须通过编辑httpd-xampp.conf文件手动允许本地主机进行截图访问此处关联

答案4

  • 在 Ubuntu 中转到

    /opt/lampp/etc/extra(默认位置)

  • 编辑 httpd-xampp.conf(需要 sudo 权限才能编辑)

    # since XAMPP 1.4.3
    <Directory "/opt/lampp/phpmyadmin">
        AllowOverride AuthConfig Limit
        Order allow,deny
        Require all granted
        Allow from all
    </Directory>
    
  • 重新启动 xampp 服务器

相关内容