Home  >  Article  >  Backend Development  >  php403 error

php403 error

angryTom
angryTomOriginal
2019-10-17 16:40:335509browse

php403 error

We use http://localhost/test.php for local testing and no problems are found. When testing on the intranet, use the IP address for access, such as: http:// 10.10.50.195/test.php, the problem of 403 error occurred. The method to solve this problem is as follows:

1. First 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
Change

to


    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
      # Deny from all
    Allow from all
      #允许所有访问
    Satisfy all

and


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

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

2. Then save, restart the service, and access again to solve the problem.

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of php403 error. For more information, please follow other related articles on the PHP Chinese website!

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
Previous article:What is timestamp in php?Next article:What is timestamp in php?