现象:本机用localhost都可以正常访问wamp的主页和phpmyadmin,但通过IP地址无法访问(如:192.168.0.231)
访问http://192.168.0.231/phpmyadmin,提示You don't have permission to access /phpmyadmin/ on this server.
解决:
打开D:\wamp\alias\phpmyadmin.conf
修改
<Directory "d:/wamp/apps/phpmyadmin4.0.4/">
Options Indexes FollowSymLinks ExecCGI
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
</Directory>
为
<Directory "d:/wamp/apps/phpmyadmin4.0.4/">
Options Indexes FollowSymLinks ExecCGI
AllowOverride all
Order Deny,Allow
Allow from all
Allow from 127.0.0.1
Allow from ::1
Allow from localhost
</Directory>
linux下
编辑httpd-xampp.conf(/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 \
81.196.40.94/32
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>