6

there is the error infomation:

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403

localhost
Apache/2.4.12 (Unix) OpenSSL/1.0.1m PHP/5.6.8 mod_perl/2.0.8-dev Perl/v5.16.3

I have setting httpd.conf file as follw:

Alias /myspace "/volumes/myspace/workspace/phpworkspace"
<Directory "/volumes/myspace/workspace/phpworkspace">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order Deny,Allow
    Allow from all
    #Require all granted
</Directory>

"/volumes/myspace/workspace/phpworkspace" this place is my location of code. I have tried many methods:

  1. Xampp Access Forbidden php
  2. New xampp security concept: Access Forbidden Error 403 - Windows 7 - phpMyAdmin
Community
  • 1
  • 1
sunshine
  • 81
  • 1
  • 6

2 Answers2

2

I have solve the problem .

in file "httpd.conf",there has another default Directory configuation like follow:

<Directory />
    AllowOverride none
    Require all denied
</Directory>

you can delete this directory or change is as follow:

<Directory />
    AllowOverride all
    Require all granted
</Directory>
sunshine
  • 81
  • 1
  • 6
  • Where the "httpd.conf" file is located? – Alireza Akbari Oct 26 '18 at 14:46
  • This answer fixed my problem too. @AlirezaAkbari open XAMPP application go to Volumes tab and mount lampp directory. Explore it then its in the etc folder. There was a default Directory configuration which blocks my connections. – Ataberk Sep 30 '20 at 00:45
1

The Order directive should be Allow first, then Deny.
Set Allow from all and don't set anything for Deny.

Change your Directory directive to this and it should work

<Directory "/volumes/myspace/workspace/phpworkspace">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order Allow,Deny
    Allow from all
    #Require all granted
</Directory>
Alex Andrei
  • 7,315
  • 3
  • 28
  • 42
  • thank you very mach ,but it doesn`t work for me . I was suspect if there has some problem with my file permisson. all my files in "workspace" is: user- "write and read" , admin- readonly ,everyone- readonly. is file permission can affact access? – sunshine Jul 08 '15 at 08:38