Forbidden:You don't have permission to access / on this server.

来源:互联网 发布:乐视网络电视for mac 编辑:程序博客网 时间:2024/06/08 03:25

在Mac下配置完PHP开发环境后,访问localhost报如下错误:

Forbidden

You don't have permission to access / on this server.


解决办法:

打开httpd.conf

sodu vi /etc/apache2/httpd.conf(Mac和Linux的打开命令)

DocumentRoot "/Users/tech/webservers"<Directory "/Users/tech/webservers">    #    # Possible values for the Options directive are "None", "All",    # or any combination of:    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews    #    # Note that "MultiViews" must be named *explicitly* --- "Options All"    # doesn't give it to you.    #    # The Options directive is both complicated and important.  Please see    # http://httpd.apache.org/docs/2.4/mod/core.html#options    # for more information.    #    #Options FollowSymLinks Multiviews    #MultiviewsMatch Any    Options indexes Multiviews    #    # AllowOverride controls what directives may be placed in .htaccess files.    # It can be "All", "None", or any combination of the keywords:    #   AllowOverride FileInfo AuthConfig Limit    #    AllowOverride All    #    # Controls who can get stuff from this server.    #    Require all granted</Directory>



0 0