一、浏览器输入localhost,提示错误:Forbidden You don’t have permission to access / on this server。
解决办法:
1、进入wamp安装目录(假定安装在D盘,D:\wamp\bin\apache\apache2.4.9\conf),打开httpd.conf文件:
检查以上两个权限设置是否正确。
2、还是httpd.conf文件
确认删除了该行前面的#号(确认引用该虚拟主机配置文件)。
3、进入目录:D:\wamp\bin\apache\apache2.4.9\conf\extra,打开httpd-vhosts.conf文件,确认添加了一下配置:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:/wamp/www"
ServerName localhost
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>
保存然后重启apache即可。
二、访问项目时,显示错误如:404,The requested URL /index.html was not found on this server.
解决办法:
进入D:\wamp\bin\apache\apache2.4.9\conf文件夹,打开httpd.conf文件:
确保删除了该行前面的#号,引入该模块。