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.