安装WAMP后,本地访问正常,局域网内其他主机访问,则出现无法访问的情况,报错为403,内容为Forbidden You don't have permission to access / on this server. Apache/2.4.23(Win64) PHP/5.6.25 Server at 192.168.17.22 Port 80。
在网上看了一些方法,主要是修改配置文件httpd.conf、httpd-vhosts.conf和修改Wamp Setting 里的Menu Item online/offline等,经过反复测试,发现只需要修改httpd-vhosts.conf配置文件,增加一行Require all granted即可,其他两个地方不需要做修改。
改完后的httpd-vhosts.conf配置文件如下:
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
DocumentRoot d:/wamp64/www
<Directory "d:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require all granted
</Directory>
</VirtualHost>
#
保存后重启,问题解决。