Heim  >  Artikel  >  Backend-Entwicklung  >  学习php时,会借助apache访问*php,但访问不了文件夹

学习php时,会借助apache访问*php,但访问不了文件夹

WBOY
WBOYOriginal
2016-06-13 12:01:23891Durchsuche

学习php时,能借助apache访问*.php,但访问不了文件夹
学习php时,能借助apache访问*.php,但访问不了文件夹,比如访问localhost,就会显示如下信息:

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

但访问localhost/test.php就可以,在网上也查了别人的解决办法

    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all

这里改成

    Options Indexes FollowSymLinks
    AllowOverride None


按照上面改了后,问题还是没解决,

------解决方案--------------------
加上下面两句:
Order allow,deny  
Allow from all
------解决方案--------------------

引用:
Quote: 引用:

加上下面两句:
Order allow,deny  
Allow from all


加上也不行,下面是我的httpt.conf文件,请帮着看一下


#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See  for detailed information about
# 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 a
#     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 to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# 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 the
# 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
# at );
# you will save yourself a lot of trouble.
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn