Home > Backend Development > PHP Tutorial > PHP错误:Forbidden You don't have permission to access / on thi_PHP教程

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

WBOY
Release: 2016-07-20 11:17:21
Original
2767 people have browsed it

Today when I was testing a php program, I discovered this problem:

Forbidden

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

At the beginning, I used http://localhost/test.php to test, and no problem was found. Later, if I want to test it on the intranet, I have to use the IP address for access, such as: http://10.10 .50.195/test.php, this problem occurred.

Later I consulted a friend (a PHP expert) and asked me to modify the PHP configuration file httpd.conf.

Find the configuration section in the original location file


Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all

was changed to


Options FollowSymLinks
AllowOverride None
Order deny,allow
# Deny from all
Allow from all

#Allow all access
Satisfy all


Also

#
# 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

was changed to

#
# 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

Then save, restart the service, and the problem will be solved when accessing.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/372024.htmlTechArticleWhen I was testing a php program today, I found this problem: Forbidden You don't have permission to access / on this server. At the beginning, I used http://localhost/test.php...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template