php+apache配置Forbidden解决

初安装 php+apache 出现错误,去掉internet选项里面友好提示的钩,显示

Forbidden

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

 

解决方法:

1.新加权限

这是由于你更改了你的DocumentRoot,而更改了这个默认值后,下面还有一个值是要随着更改的。就在它下面不远的地方,有这样一段:
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/Your_New_DocumentRoot/">
中括号里的内容就是你更改的新值。这样就不会出现403错误了。

<Directory "/var/www/html1/">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

 2.直接改root目录的所有权限

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    deny from all
    Satisfy all
</Directory>

把deny from all中的deny改成了allow,保存后重起了apache

你可能感兴趣的:(apache,PHP,Access,internet)