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

时间:2012-08-17 03:27:30

标签: phpmyadmin xampp

我刚为linux安装了xampp 1.8.0,当我打开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".

我试过this帖子,但没有运气。请帮忙。我是从自己的PC上打开它,而不是从任何其他网络打开它。

11 个答案:

答案 0 :(得分:45)

打开你的http.conf文件

vim /opt/lampp/etc/extra/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>

修改
尝试在“ErrorDocument”行之前添加“Allow from all”。 希望它有所帮助。

答案 1 :(得分:26)

添加到Sekar回答

不要忘记重新启动XAMPP服务器

更新已接受的答案:

现在您需要发表评论“需要本地”

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

答案 2 :(得分:25)

如果您看到以下错误消息,请尝试进入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/

答案 3 :(得分:17)

对我来说没什么用,但是关注的事情很棒:

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)现在最后使用此命令重新启动xampp / opt / lampp / lampp restart

就是这样,你就完成了!

它也适用于xampp。 :)

答案 4 :(得分:6)

  

嘿,请使用这些代码部分。

     

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>

答案 5 :(得分:2)

将&#34;允许来自所有&#34;后,您需要重新启动xampp才能应用该设置。感谢

答案 6 :(得分:0)

在Xampp 5.6.3 Windows上 路径C:\ xampp \ apache \ conf \ extra \ httpd-xampp.conf 评论:#Require local

  

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

答案 7 :(得分:0)

在xampp的较新版本中,您可以使用另一种方法,首先打开您的httpd-xampp.conf文件,然后使用ctrl + F命令找到字符串“ phpmyadmin”(Windows)。 然后替换此代码

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

与此

Alias /phpmyadmin "D:/server/phpMyAdmin/"
<Directory "D:/server/phpMyAdmin">
    AllowOverride AuthConfig
    Require all granted
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

别忘了重新启动Xampp。

答案 8 :(得分:0)

在osx上登录到终端并执行

sudo nano /opt/lampp/etc/extra/httpd-xampp.conf

并替换

<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>

与此

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

然后重新启动apache和mysql

或使用此命令

 /opt/lampp/xampp restart

答案 9 :(得分:0)

不需要更改文件/opt/lampp/etc/extra/httpd-xampp.conf.中的所有配置 您唯一需要更改的是Require local Require local的含义很明显,因此只需更改为Require all granted 要求所有授予

解决方案

Require local Require all granted

答案 10 :(得分:0)

上述解决方案是正确的,但挑战在于定位特定文件。

访问 mac https://www.youtube.com/watch?v=OVGCXYZ-BoI

访问windows https://www.youtube.com/watch?v=MvYyEPaNNhE

说明(如果对视频不感兴趣)

<块引用> <块引用>

MAC

步骤

  1. 启动您的 xampp 应用程序
  2. 启动服务

enter image description here

  1. 点击“卷”菜单
  2. 点击挂载
  3. 点击探索

enter image description here

<块引用> <块引用>

N.B 打开 opt/lampp/ 窗口 enter image description here

  1. 打开以下目录定位文件 灯/etc/extra/httpd-xampp-conf
  2. 使用您选择的任何 IDE 打开文件,例如 Visual Studio 或 PhpStorm 或文本编辑器
  3. 找到以下代码并将 Require local 替换为 Require all granted
<块引用> <块引用> <块引用>

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

  1. 确保重新启动所有服务

  2. 重新加载您的页面和 Whuala.....它有效