PHP Error: Forbidden don ' t have permission to access/on this server

Source: Internet
Author: User
Tags php error

Today, while testing a PHP program, I found this problem:

Forbidden

You don ' t have permission to access/on this server.

At the beginning I was using http://localhost/test.php to carry out the test, did not find the problem, and then to be tested in the intranet will use IP address for that visit, such as: http://10.10.50.195/test.php, there is this problem.

Later consulted a friend (PHP master), said to modify the PHP configuration file httpd.conf.

Locate the configuration section in the original location file

<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all
Satisfy All
</Directory>

Modified into

<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
# Deny from all
Allow from all

#允许所有访问
Satisfy All
</Directory>


And also

<directory "D:/wamp5/www" >

    #
    # Possible values for the Options directive are ' None ', ' All ',
&NBSP;&N bsp;  # or any combination of:
    #   Indexes Includes followsymlinks symlinksifownerm Atch execcgi multiviews
    #
    # "MultiViews" must be named *explicitly *---"Options all"
    # doesn ' t give it to you.
    #
    # The Options directive are both complicated and important.  please
    # http://httpd.apache.org/do Cs/2.2/mod/core.html#options
    # for more information.
    #
  & nbsp Options Indexes followsymlinks

#
# AllowOverride Controls What directives may 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 this server.
#
# onlineoffline Tag-don ' t remove
Order Deny,allow
Deny from all
Allow from 127.0.0.1

</Directory>

Modified into

<directory "D:/wamp5/www" >

    #
    # Possible values for the Options directive are ' None ', ' All ',
&NBSP;&N bsp;  # or any combination of:
    #   Indexes Includes followsymlinks symlinksifownerm Atch execcgi multiviews
    #
    # "MultiViews" must be named *explicitly *---"Options all"
    # doesn ' t give it to you.
    #
    # The Options directive are both complicated and important.  please
    # http://httpd.apache.org/do Cs/2.2/mod/core.html#options
    # for more information.
    #
  & nbsp Options Indexes followsymlinks

#
# AllowOverride Controls What directives may 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 this server.
#
# onlineoffline Tag-don ' t remove
Order Deny,allow
# Deny from all

# Allow from 127.0.0.1
Allow from all

</Directory>

Then save and restart the service to solve the problem on the access.

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.