MacOS XAMPP禁止访问错误403-您无权访问所请求的目录 [英] MacOS XAMPP Access Forbidden Error 403 - You don't have permission to access the requested directory

查看:82
本文介绍了MacOS XAMPP禁止访问错误403-您无权访问所请求的目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些PHP Web应用程序在macOS 10.15上运行XAMPP 7.4.1.XAMPP过去为我工作过.我的开发环境搞砸了,因为32位应用程序使Catalina瘫痪了,而我以前的XAMPP安装没有打开.我已经设置了VirtualHosts,但是现在当我尝试访问其中一个站点时,出现以下错误.

I have some PHP web apps running off XAMPP 7.4.1 on macOS 10.15. XAMPP has worked for me in the past. I got my dev environment screwed up because 32 bit apps sh*t the bed with Catalina, and my old XAMPP installation didn't open. I got my VirtualHosts set back up, but now when I try to access one of my sites I get the following error.

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

我的虚拟主机如下所示:

My virtual hosts look like the following:

# localhost
<VirtualHost *:80>
    ServerName localhost
    DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
    <Directory "/Applications/XAMPP/xamppfiles/htdocs">
        Options Indexes FollowSymLinks Includes execCGI
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

#####################
# PERSONAL PROJECTS #
#####################

# Dunsparce.net
<VirtualHost *:80>
    ServerName dunsparce.net
    DocumentRoot "/Users/danielschnoll/Documents/Projects/Dunsparce.net"
    <Directory "/Users/danielschnoll/Documents/Projects/Dunsparce.net">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog "logs/dunsparce-error_log"
</VirtualHost>

我列出了更多的VirtualHost,它们都遵循相同的格式.我在每个代码上都有 Require all grant ,以及 Allow Override All Options ... 行.就像我在帖子开头所说的那样,它们都是过去的作品.我还确定我的 httpd.conf 文件中没有注释的#包含,尽管我很确定Access Forbidden错误与之完全无关.

I have more VirtualHosts listed and they all follow the same format. I have Require all granted on each one, as well as the Allow Override All and the Options... line. Like I said at the start of the post, they all worked in the past. I also have the # Include uncommented in my httpd.conf file, though I'm pretty sure Access Forbidden error is completely unrelated to it.

有什么想法吗?

推荐答案

我不得不重新编辑 httpd.conf .其中有一个 User 组权限的部分.默认情况下,它会显示

I wound up having to edit httpd.conf again. There’s a section for User group permissions. By default it says

User daemon
Group daemon

User daemon 更改为您的macOS用户名.对我来说,我的 User 组现在看起来像

Change the User from daemon to your macOS Username. For me, my User group now looks like

User danielschnoll
Group daemon

这篇关于MacOS XAMPP禁止访问错误403-您无权访问所请求的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆