码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2016-02-16 14:55:44      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:

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

Forbidden

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

 技术分享

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

 

修改一下php的配置文件httpd.conf。

 

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

  1. <Directory/>
  2.     AllowOverrideNone
  3.     Order deny,allow
  4.    Deny from all
  5.     Satisfy all
  6. </Directory>
 

修改成

  1. <Directory/>
  2.     OptionsFollowSymLinks
  3.     AllowOverrideNone
  4.     Order deny,allow
  5. #    Deny from all
  6.    Allow from all
  7. #允许所有访问
  8.     Satisfy all
  9. </Directory>
 

 

还有

 

  1. <Directory"D:/Wamp5/www">
  2.     #
  3.     # Possible values for the Options directive are "None", "All",
  4.     # or any combination of:
  5.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  6.     #
  7.     # Note that "MultiViews" must be named *explicitly* --- "Options All"
  8.     # doesn‘t give it to you.
  9.     #
  10.     # The Options directive is both complicated and important.  Please see
  11.     # http://httpd.apache.org/docs/2.2/mod/core.html#options
  12.     # for more information.
  13.     #
  14.     OptionsIndexesFollowSymLinks
  15.     #
  16.     # AllowOverride controls what directives may be placed in .htaccess files.
  17.     # It can be "All", "None", or any combination of the keywords:
  18.     #   Options FileInfo AuthConfig Limit
  19.     #
  20.     AllowOverride all
  21.     #
  22.     # Controls who can get stuff from this server.
  23.     #
  24. #   onlineoffline tag - don‘t remove
  25.     OrderDeny,Allow
  26.     Deny from all
  27.     Allow from 127.0.0.1
  28. </Directory>
 

修改成

 

  1. <Directory"D:/Wamp5/www">
  2.     #
  3.     # Possible values for the Options directive are "None", "All",
  4.     # or any combination of:
  5.     #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  6.     #
  7.     # Note that "MultiViews" must be named *explicitly* --- "Options All"
  8.     # doesn‘t give it to you.
  9.     #
  10.     # The Options directive is both complicated and important.  Please see
  11.     # http://httpd.apache.org/docs/2.2/mod/core.html#options
  12.     # for more information.
  13.     #
  14.     OptionsIndexesFollowSymLinks
  15.     #
  16.     # AllowOverride controls what directives may be placed in .htaccess files.
  17.     # It can be "All", "None", or any combination of the keywords:
  18.     #   Options FileInfo AuthConfig Limit
  19.     #
  20.     AllowOverride all
  21.     #
  22.     # Controls who can get stuff from this server.
  23.     #
  24. #   onlineoffline tag - don‘t remove
  25.     OrderDeny,Allow
  26. #    Deny from all
  27. #  Allow from 127.0.0.1
  28.     Allow from all
  29. </Directory>
 

然后保存,重启服务,再访问就解决了这个问题。

 

修改后的截图:

技术分享

 

技术分享

魔芋:用手机访问测试。

成功!!

 

**





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

标签:

原文地址:http://www.cnblogs.com/moyuling/p/5192562.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!