Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

access forbidden xampp in mac php

Tags:

php

macos

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
like image 425
sunshine Avatar asked Jul 08 '15 08:07

sunshine


People also ask

What is forbidden in PHP?

403 Forbidden – you don't have permission to access this resource is an HTTP status code that occurs when the web server understands the request but can't provide additional access.

How to Fix Error 403 access Forbidden for phpMyAdmin in XAMPP server?

Although XAMPP error 403 can be annoying, it's easy to solve whether you're using Windows, macOS, or Linux. All you have to do is edit the XAMPP httpd-xampp. conf file to ensure that everyone has access to phpMyAdmin. Then the 403 error should disappear right away.

Where is Httpd xampp conf on Mac?

The main XAMPP configuration files are located as follows: Apache configuration file: /Applications/XAMPP/xamppfiles/etc/httpd. conf, /Applications/XAMPP/xamppfiles/etc/extra/httpd-xampp. conf.


2 Answers

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>
like image 187
sunshine Avatar answered Oct 16 '22 08:10

sunshine


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>
like image 25
Alex Andrei Avatar answered Oct 16 '22 09:10

Alex Andrei