Workaround for PHP server (Apache) 403 Forbidden Errors

Source: Internet
Author: User
Tags php server php tutorial 403 forbidden error
workaround when a 403 Forbidden error occurs in the Apache server. If you need a friend, you can refer to it below.

Configuration of the next virtual host, localhost open found error:
HTTP Error 403-forbidden, that is, 403 forbidden:you don't have the permission to access/on the this server.

May be an issue caused by insufficient permissions.

Open the Apache configuration file httpd.conf, and check it line by row.
Found it:

code example:

Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all

Since PHP is configured, "denyfrom all" here denies all connections.

You can resolve the issueby modifying this line to allow from all.

The modified code is:

code example:

Options FollowSymLinks
AllowOverride None
Order Deny,allow
Allow from all

Browser open http://localhost, problem solved.

In the Apache server, when encountering 403 forbidden access, focus on the Apache httpd.conf configuration file, whether there is "Deny from all" code.
This may be modified after some configuration files, restart Apache, is automatically changed.

Attached, another example of an Apache 403 error.

Apache 403 error, display information as follows:
You do not have permission to view this page
You may not have permission to view this directory or Web page with the credentials you provide
If you are sure you can view the directory or webpage, try contacting the website using the email address or phone listed on the home page.
You can click Search to find information on the Internet.

HTTP Error 403-Access Forbidden
Internet Explorer

Remove the hook that displays friendly information after the Forbidden you do not have the permission to access \ in this server.
Check the configuration file httpd.conf to find such a paragraph:

code example:

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

Then try to change the deny from all to allow, after saving the Apache, access to the test site is completely normal.
After upgrading to version 2.2, Apache offers and supports a number of modules, as well as improvements in performance and security.
Once you've configured Apache's httpd.conf, you're ready to use it.
But now there must be additional configuration for this file, otherwise HTTP 403 permissions issue error.

The following is a section of the original code for the httpd.conf file.
Change the following code Red flag:

code example:

# Possible values for the Options directive is "None", "all",
# or any combination of:
# Indexes includes followsymlinks symlinksifownermatch execcgi multiviews
# Note that "MultiViews" must is named *explicitly*---"Options all"
# doesn ' t give it to you.
# The Options directive is both complicated and important. Please see
# [Url][/url]
# for more information.
Options Indexes FollowSymLinks
# AllowOverride Controls What directives is 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 the this server.
# onlineoffline Tag-don ' t remove
Order Deny,allow
Deny from all
Allow from

The red section is changed to allow by all, that is, all access is allowed through.

The above describes the solution to the PHP server (Apache) 403 Forbidden error, including the content, I hope the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.