Solution to the 403Forbidden error under the php Server (apache)

Source: Internet
Author: User
Tags 403 forbidden error
: This article describes how to solve the 403Forbidden error under the php Server (apache). If you are interested in the PHP Tutorial, refer to it. The solution to the 403 Forbidden Error on the apache server. For more information, see.

When the virtual host is configured, an error is found when localhost is opened:
HTTP Error 403-access prohibited, that is, 403 Forbidden: You don't have permission to access/on this server.

It may be caused by insufficient permissions.

Solution:
Open the configuration file httpd. conf of apache and check it row by row.
Find:

Sample code:


Options FollowSymLinks
AllowOverride None
Order deny, allow
Deny from all

After php is configured, "Deny from all" is used to Deny all connections.

Modify this row to "Allow from all" to solve the problem.

The modified code is as follows:

Sample code:


Options FollowSymLinks
AllowOverride None
Order deny, allow
Allow from all

Open http: // localhost in the browser to solve the problem.

Summary:
On the apache server, when access is disabled by 403, pay attention to whether the apache httpd. conf configuration file contains code such as "Deny from all.
This may be because apache is automatically changed after some configuration files are modified.

Appendix, an example of apache 403 error.

Apache 403 error. the following information is displayed:
You do not have permission to view this webpage
You may not have the permission to view this directory or webpage with the creden you provided
If you are sure you can view this directory or webpage, try to contact your website by using the email address or phone number listed on the 192.168.1.5 homepage.
You can click search to find information on the Internet.

HTTP Error 403-access prohibited
Internet Explorer

The Forbidden You don't have permission to access \ on this server is displayed.
Check the configuration file httpd. conf and find the following section:

Sample code:


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

Then, I tried to change deny from all to allow. after saving the settings, I restarted apache and accessed the test website.
After APACHE is upgraded to version 2.2, it provides and supports the support of many modules, and also improves the performance and security.
After httpd. conf of apache is configured, you can use it.
However, you must configure this file in other ways. Otherwise, an http 403 Permission error occurs.

Solution.
The following is a piece of original code in the httpd. conf file.
Change the red flag of the following code:

Sample code:


#
# Possible values for the Options directive are "None", "All ",
# Or any combination:
# 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
# [Url] http://httpd.apache.org/docs/2.2/mod/core.html#options#/url]
# 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

The red part is changed to Allow from all, that is, all access requests are allowed.


The above describes how to solve the 403 Forbidden error under the php Server (apache), including some content, and hope to help those who are interested in the PHP Tutorial.

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: info-contact@alibabacloud.com 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.