Home >Backend Development >PHP Tutorial >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
WBOYOriginal
2016-07-25 09:12:181181browse

The test was conducted using http://localhost/test.php and no problem was found. Later, if you want to test it on the intranet, you need to use the IP address for access, such as: http://10.10.50.195/test.php, This problem arises. Modify the php configuration file httpd.conf. Find the configuration section in the original location file:

  1. Options FollowSymLinks
  2. AllowOverride None
  3. Order deny,allow
  4. Deny from all
  5. Satisfy all
Copy code

Modified to:

  1. Options FollowSymLinks
  2. AllowOverride None
  3. Order deny,allow
  4. # Deny from all
  5. Allow from all
  6. #Allow all access
  7. Satisfy all
Copy Code

Also:

  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
Copy the code

and modify it to:

  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
Copy the code

then save, restart the service, and visit again It was discovered that the problem had been resolved.



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn