首页 >后端开发 >php教程 >PHP错误:Forbidden You don't have permission to access / on this server

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

WBOY
WBOY原创
2016-07-25 09:12:181183浏览

用http://localhost/test.php进行的测试,没有发现问题,后来要在内网测试一下就要用IP地址进行那个访问了,如:http://10.10.50.195/test.php,就出现了这个问题。 修改一下php的配置文件httpd.conf。 在原有的位置文件中找到配置节:

  1. Options FollowSymLinks
  2. AllowOverride None
  3. Order deny,allow
  4. Deny from all
  5. Satisfy all
复制代码

修改成:

  1. Options FollowSymLinks
  2. AllowOverride None
  3. Order deny,allow
  4. # Deny from all
  5. Allow from all
  6. #允许所有访问
  7. Satisfy all
复制代码

还有:

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

修改成:

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

然后保存,重启服务,再次访问时发现问题已解决了。



声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn