在mac下配置完apache和php环境后,经过localhost访问页面,出现403Forbidden。页面提示php
Forbiddenapache
You don’t have permission to access / on this server.
1:解决办法是修改/etc/apache/httpd.conf的配置
2:若是你只要配置虚拟主机,能够在虚拟主机里面写这个配置app
若是apache版本是2.2的话,应该这么写ide
<Directory "/Users/apple/Sites/"> Options Indexes MultiViews AllowOverride All # OSX 10.9 / Apache 2.2 Order from deny, allow </Directory>
若是apache版本是2.4的话,应该这么写ui
<Directory "/Users/apple/Sites/"> Options Indexes MultiViews AllowOverride All # OSX 10.10 / Apache 2.4 Require all granted </Directory>