Php – access forbidden xampp in mac php

macosPHP

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

Best Answer

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>