XAMPP在macOS下无法访问phpmyadmin的问题(Enable Remote Access)

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

XAMPP在macOS下无法访问phpmyadmin原因

权限不足

编辑”httpd-xampp.conf文件增加权限

  1. 打开XAMPP面板>Volumes>/opt/lampp为”Mount“状态;
  2. 点击Explore;
  3. 依次打开路径:etc/extra/中”httpd-xampp.conf”文件;
  4. 找到<Directory "/opt/lampp/phpmyadmin">并修改里面内容;
  5. 将Require local这行替换为以下内容:
    1
    Order allow,deny
    2
    Allow from all
    3
    Require all granted
  6. 保存”httpd-xampp.conf”文件;
  7. 重启Apache:打开XAMPP面板>Services>Apache>Restart。

参考文献

Access to the requested object is only available from the local network phpmyadmin
https://stackoverflow.com/questions/11999371/access-to-the-requested-object-is-only-available-from-the-local-network-phpmyadm/20965749

后面发现官方有相关文档,名为:Enable Remote Access to phpMyAdmin(文档路径:<你的IP>/dashboard/docs/access-phpmyadmin-remotely.html);
其实主要修改Require这行即可!

下载XAMPP

https://www.apachefriends.org/