PHP error: forbidden you don't have permission to access/on this server.

Source: Internet
Author: User

Testing a PHP program todayProgramWhen you find this problem:

Forbidden

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

 

At the beginning, I used http: // localhost/test. no problem was found in the test conducted by PHP. Later, you need to use the IP address to perform the access test on the Intranet, for example, http: // 10.50.195/test. PHP.

Later, I consulted a friend (PhP expert) to modify the PHP configuration file httpd. conf.

Find the configuration section in the original location file

<Directory/>
Options followsymlinks
AllowOverride none
Order deny, allow
Deny from all
Satisfy all
</Directory>

Modify

<Directory/>
Options followsymlinks
AllowOverride none
Order deny, allow
# Deny from all
Allow from all

# Allow all access
Satisfy all
</Directory>

 

And

 

<Directory "D:/wamp5/www">

#
# possible values for the options directive are "NONE", "all",
# or any combination:
# indexes events des 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
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#< br> 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

</Directory>

Modify

 

<Directory "D:/wamp5/www">

#
# 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
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# 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
Allow from all

</Directory>

Save and restart the service. The problem is solved during access.

 

As you are new to Alibaba Cloud and are on the road, write down your notes.

 

 

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.