我知道這已被問過很多次,但所有的答案似乎相同,都沒有爲我工作。phpmyadmin - 禁止 - 您沒有權限訪問/ phpmyadmin /在這臺服務器上
我想從本地主機以外的其他地方訪問phpmyadmin GUI。
我收到錯誤「禁止 - 您無權訪問此服務器上的/ phpmyadmin /」。在瀏覽器中。
我使用CentOS7,Apache 2.4.6和phpMyAdmin-4.4.15.10-1.el7。
我已經試過這樣:
<Directory /usr/share/phpMyAdmin/>
Order Allow,deny
Allow from all
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
Order Allow,deny
Allow from all
</Directory>
大多數人似乎認爲我可以這樣做:
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require all granted
</RequireAny>
</IfModule>
或者:
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 192.168.1.6
</RequireAny>
</IfModule>
但什麼都沒有工作。
這是當前的狀態:
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 192.168.1.6
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Allow,Deny
Allow from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
仍然得到:
故宮
您沒有權限訪問/ phpMyAdmin的/在此服務器上。
編輯 -
正如更多的信息,我已經停用SELinux和放在/ usr /共享/ phpMyAdmin的確信權限是否正確。
編輯再次 -
現在我已經試過這...
<Directory /usr/share/phpMyAdmin/>
Require all granted
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
Require all granted
</Directory>
這肯定是基本就能搞定,但我仍然得到錯誤?
「要求所有授予」是關鍵 – Teddy