Apache is used to access * php but cannot access folders when learning php.

Source: Internet
Author: User
When learning php, you can use apache to access *. php, but cannot access the folder to learn php, you can use apache to access *. php, but cannot access folders. for example, if you access localhost, the following information is displayed: ForbiddenYou & nbsp; dont & nbsp; have & nbsp; permission & nbsp; to & nbsp; access & nbsp; on & nbsp; when learning php, you can use apache to access *. php, but cannot access folders
When learning php, you can use apache to access *. php, but cannot access folders. for example, accessing localhost will display the following information:

Forbidden

You don't have permission to access/on this server.
Apache/2.0.59 (Win32) PHP/5.1.6 Server at localhost Port 80

However, you can access localhost/test. php and check other people's solutions online.

Options FollowSymLinks
AllowOverride None
Order deny, allow
Deny from all

Change

Options Indexes FollowSymLinks
AllowOverride None


After the above changes, the problem still persists,

------ Solution --------------------
Add the following two sentences:
Order allow, deny
Allow from all
------ Solution --------------------
Reference:
Quote: reference:

Add the following two sentences:
Order allow, deny
Allow from all


I can't add it. The following is my httpt. conf file. please take a look.


#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains
# Configuration directives that give the server its instructions.
# See # The directives.
#
# Do NOT simply read the instructions in here without understanding
# What they do. They're here only as hints or reminders. If you are unsure
# Consult the online docs. You have been warned.
#
# The configuration directives are grouped into three basic sections:
#1. Directives that control the operation of the Apache server process as
# Whole (the 'global environment ').
#2. Directives that define the parameters of the 'main' or 'default' server,
# Which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# Of all virtual hosts.
#3. Settings for virtual hosts, which allow Web requests to be sent
# Different IP addresses or hostnames and have them handled by
# Same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for example
# Of the server's control files begin with "/" (or "drive:/" for Win32),
# Server will use that explicit path. If the filenames do * not * begin
# With "/", the value of ServerRoot is prepended -- so "logs/foo. log"
# With ServerRoot set to "C:/Program Files/Apache Group/Apache2" will be interpreted by
# Server as "C:/Program Files/Apache Group/Apache2/logs/foo. log ".
#
# NOTE: Where filenames are specified, you must use forward slashes
# Instead of backslashes (e.g., "c:/apache" instead of "c: \ apache ").
# If a drive letter is omitted, the drive on which Apache.exe is located
# Will be used by default. It is recommended that you always supply
# An explicit drive letter in absolute paths, however, to avoid
# Confusion.
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# Such as the number of concurrent requests it can handle or where it
# Can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# Configuration, error, and log files are kept.
#
# NOTE! If you intend to place this on an NFS (or otherwise network)
# Mounted filesystem then please read the LockFile documentation (available
# # You will save yourself a lot of trouble.

Related Article

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.