問題場景:php
本機搭建一個apache服務器,正常訪問XAMPP目錄下的頁面。html
手機接入同一wifi,以電腦ip方式訪問該目錄下的頁面;提示:Access Deniedweb
Access to the requested directory is only available from the local network.
This setting can be configured in the file 「httpd-xampp.conf」. apache
解決辦法:服務器
一、按照提示找到httpd-xampp.conf文件,路徑在「/xampp/apache/conf/extra/httpd-xampp.conf」編輯器
二、文本編輯器打開文件,找到配置項:New XAMPP security conceptide
三、註釋原來的配置修改成容許訪問。ui
#
# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
#Require local
AllowOverride AuthConfig
Require all granted
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</LocationMatch>server