您当前的位置: 首页 > 网站编程 > PHP教程 > PHP错误:Forbidden You don't have permission to access / on

PHP错误:Forbidden You don't have permission to access / on

作者:不详 来源:网络 发布时间: 2014-08-18 14:49 点击:
今天在测试一个php程序的时候,发现这个问题: Forbidden You don't have permission to access / on this server. 开始的时候我是用http://localhost/test.php进行的测试,没有发现问题,后来要在内网测试一下就要用IP地址进行那个访问了,如:http://10.10.50.195/tes

PHP错误:Forbidden You don't have permission to access / on

  今天在测试一个php程序的时候,发现这个问题:

  Forbidden

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

  开始的时候我是用http://localhost/test.php进行的测试,没有发现问题,后来要在内网测试一下就要用IP地址进行那个访问了,如:http://10.10.50.195/test.php,就出现了这个问题。

  后来咨询了一下朋友(php高手),说修改一下php的配置文件httpd.conf。

  在原有的位置文件中找到配置节

  <Directory />

     Options FollowSymLinks

     AllowOverride None

     Order deny,allow

     Deny from all

     Satisfy all

  </Directory>

  修改成

  <Directory />

     Options FollowSymLinks

     AllowOverride None

     Order deny,allow

  #   Deny from all

     Allow from all

  #允许所有访问

     Satisfy all

  </Directory>

  还有

  <Directory "D:/Wamp5/www">

     #

     # 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.2/mod/core.html#options

     # for more information.

     #

     Options Indexes FollowSymLinks

     #

     # AllowOverride controls what directives may be placed in .htaccess files.

     # It can be "All", "None", or any combination of the keywords:

     #  Options FileInfo AuthConfig Limit

     #

     AllowOverride all

     #

     # Controls who can get stuff from this server.

     #

  #  onlineoffline tag - don't remove

     Order Deny,Allow

     Deny from all

     Allow from 127.0.0.1

  </Directory>

  修改成

  <Directory "D:/Wamp5/www">

     #

     # 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.2/mod/core.html#options

     # for more information.

     #

     Options Indexes FollowSymLinks

     #

     # AllowOverride controls what directives may be placed in .htaccess files.

     # It can be "All", "None", or any combination of the keywords:

     #  Options FileInfo AuthConfig Limit

     #

     AllowOverride all

     #

     # Controls who can get stuff from this server.

     #

  #  onlineoffline tag - don't remove

     Order Deny,Allow

  #   Deny from all

  # Allow from 127.0.0.1

     Allow from all

  </Directory>

  然后保存,重启服务,在访问就解决了这个问题。
分享到:
本文"PHP错误:Forbidden You don't have permission to access / on"由远航站长收集整理而来,仅供大家学习与参考使用。更多网站制作教程尽在远航站长站。
顶一下
(0)
0%
踩一下
(0)
0%
[点击 次] [返回上一页] [打印]
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 密码: 验证码:
关于本站 - 联系我们 - 广告合作 - 网站声明 - 友情连接- 网站地图 - 站点地图 - 返回顶部
Copyright © 2007-2013 www.yhzhan.com(远航站长). All Rights Reserved .
远航站长:为中小站长提供最佳的学习与交流平台,提供网页制作与网站编程等各类网站制作教程.
官方QQ:445490277 网站群:26680406 网站备案号:豫ICP备07500620号-4