2017-04-25 55 views
4

當我嘗試使用的IP地址在另一臺PC訪問XAMPP的phpMyAdmin的我得到這個錯誤:XAMPP - 訪問請求的對象只能從本地網絡

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

我正在尋找解決方案並發現一些建議,如修改httpd-xampp.conf文件。

1)選項是修改<LocationMatch>塊這樣的:

<LocationMatch "^/(?i(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))"> 
    Order deny,allow 
    Allow from all 
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var 
</LocationMatch> 

的問題是,我httpd-xampp.conf文件不包含這樣的塊,但如果我嘗試將其添加到文件I結束仍然會得到相同的錯誤。

2)選項是修改<Directory "C:/xampp/phpMyAdmin">如下:

<Directory "C:/xampp/phpMyAdmin"> 
    AllowOverride AuthConfig Limit 
    Order allow,deny 
    Allow from all 
    Require all granted 
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var 
</Directory> 

或者

<Directory "C:/xampp/phpMyAdmin"> 
    AllowOverride AuthConfig Limit 
    Order allow,deny 
    Allow from all 
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var 
</Directory> 

或者

<Directory "C:/xampp/phpMyAdmin"> 
    AllowOverride AuthConfig Limit 
    Require all granted 
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var 
</Directory> 

這並沒有解決任何問題。仍然有相同的錯誤。

P.S.每次更改後我都會重新啓動Apache!

有人可以看到我可能會失蹤?

+0

不要在同一配置中同時使用Apache 2.2和Apache 2.4語法 – RiggsFolly

+0

我一次只使用一個,仍然出錯 –

+0

不在選項2中,您不需要。使用「允許允許,拒絕全部允許」(Apache 2。2語法)或'要求所有授予'(Apache 2.4語法) – RiggsFolly

回答

10

我剛修好了! 請訪問:

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

和如下改變所有的內容:

<Directory "C:/xampp/phpMyAdmin"> 
    AllowOverride AuthConfig Limit 
    Order allow,deny 
    Require all granted 
    Allow from all 
</Directory> 
+0

看來祕密是刪除「ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var」 –

+0

超棒的作品! – Dilip

1

沒有爲我工作,但下面的事情是真棒:

1)打開

httpd-xampp.conf

這是在

/opt/lampp/etc/extra/

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

3)現在只需添加需要之前

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。 :)