首页 文章

只能从本地网络phpmyadmin访问所请求的对象

提问于
浏览
20

我刚刚为linux安装了xampp 1.8.0,当我打开phpmyadmin时,我遇到了这个错误Access Forbidden !!

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".

我试过了this但没有运气 . 请帮忙 . 我是从我自己的电脑上打开它而不是从任何其他网络打开它 .

7 回答

  • 26

    打开你的http.conf文件

    vim /opt/lampp/etc/extra/httpd-xampp.conf
    

    在下一节中注释“ Deny from all ”,

    #
    # 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>
    

    Edit:
    尝试在"ErrorDocument"行之前添加"Allow from all" . 希望能帮助到你 .

  • 5

    在Xampp 5.6.3 Windows路径C:\ xampp \ apache \ conf \ extra \ httpd-xampp.conf中注释:#Require local

    新的XAMPP安全概念...... #Require local ...

  • 0

    如果您看到以下错误消息,请尝试进入 phpyAdmin

    New XAMPP security concept:
    Access to the requested directory is only available from the local network.
    This setting can be configured in the file "httpd-xampp.conf".
    

    您可以执行下一步(对于XAMPP,部署在UNIX系统上):您可以尝试更改 <Directory "/opt/lampp/phpmyadmin"> 的配置

    # vi /opt/lampp/etc/extra/httpd-xampp.conf
    

    并将安全设置更改为

    #LoadModule perl_module        modules/mod_perl.so
    
    <Directory "/opt/lampp/phpmyadmin">
        AllowOverride AuthConfig Limit
        Order allow,deny
        Allow from all
        Require all granted
        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
    </Directory>
    

    首先 - 评论pl模块,第二 - 更改节点目录的配置 . 之后,您应该重新启动 httpd 守护程序

    # /opt/lampp/xampp restart
    

    现在你可以访问http://[server_ip]/phpmyadmin/

  • 19

    在设置“Allow from all”之后,您需要重新启动xampp以应用设置 . 谢谢

  • 2

    没有什么对我有用,但跟随的东西很棒:

    1)打开

    httpd-xampp.conf

    在...

    / opt / lampp / etc / extra /

    2)找到 <Directory "/opt/lampp/phpmyadmin">

    3)现在只需添加Require all grant

    4)所以代码看起来像这样
    <Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Limit Order allow,deny Allow from all Require all granted </Directory>

    5)现在最后使用此命令/ opt / lampp / lampp restart重新启动xampp

    就是这样,你就完成了!

    它也适用于xampp . :)

  • 10

    添加到Sekar回答

    Don't forget to restart your XAMPP Server

    更新接受的答案:

    现在你需要评论需要本地

    #
    # New XAMPP security concept
    #
    <LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
            #Require local
        ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
    
  • 43

    嘿,使用这些代码部分 . xampp的路径是:apache \ conf \ extra \ httpd-xampp.conf

    <LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
            Order deny,allow
            Allow 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/HTTP_XAMPP_FORBIDDEN.html.var
        </LocationMatch>
    

相关问题