环境说明:
Ubuntu: 截止本文发布时,ubuntu的最新版本为12.04.本文所讲述故障也是发生于此版本环境下
XAMPP: xampp-linux-1.8.0.tar.gz
安装过程不细说,直接介绍安装完毕后访问http://localhost/phpmyadmin/ 时出现如下提示:
Access forbidden!
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”.
解决办法:
进入命令行模式,先将账户切换至root
$ sudo -s
vi打开需要编辑的httpd-xampp.conf文件
# vi /opt/lampp/etc/extra/httpd-xampp.conf
(vi如何操作,请查阅相关内容)
找到这段代码:
# since XAMPP 1.4.3
<Directory “/opt/lampp/phpmyadmin”>
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
</Directory>
为其增加一行Require all granted,最后如下所示:
# since XAMPP 1.4.3
<Directory “/opt/lampp/phpmyadmin”>
AllowOverride AuthConfig Limit
Order allow,deny
Allow from all
Require all granted
</Directory>
保存并退出。重启XAMPP 。
操作完毕。