apache XAMPP localhost -更改目录后出现拒绝访问错误403

7vux5j2d  于 2022-12-14  发布在  Apache
关注(0)|答案(1)|浏览(208)

我正在用php storm做一个项目,我试着从内置的web服务器改为apache服务器,因为它扰乱了我的url重定向。
使用mac,我将目录更改为以下目录:

DocumentRoot "/Users/x/Desktop/CMS"
<Directory "/Users/x/Desktop/CMS">

重新启动服务器后,在搜索栏中键入localhost应该会将我引导到index.php文件,但我得到:

错误403访问被拒绝

项目结构如下:

我还在部署中配置了xampp服务器,如下所示:

apache服务器的错误日志给予了我这些,所以我试阅读用sudo和chmod修改权限,但我真的不知道我在做什么。

[Tue Jan 25 12:00:45.361077 2022] [core:error] [pid 4447] (13)Permission denied: [client ::1:49579] AH00035: access to / denied (filesystem path '/Users/x/Desktop') because search permissions are missing on a component of the path
[Tue Jan 25 12:00:45.430624 2022] [core:error] [pid 4447] (13)Permission denied: [client ::1:49579] AH00035: access to /favicon.ico denied (filesystem path '/Users/x/Desktop') because search permissions are missing on a component of the path, referer: http://localhost/
[Tue Jan 25 12:00:45.527855 2022] [core:error] [pid 4447] (13)Permission denied: [client ::1:49579] AH00035: access to / denied (filesystem path '/Users/x/Desktop') because search permissions are missing on a component of the path
[Tue Jan 25 12:00:45.580902 2022] [core:error] [pid 4447] (13)Permission denied: [client ::1:49579] AH00035: access to /favicon.ico denied (filesystem path '/Users/x/Desktop') because search permissions are missing on a component of the path, referer: http://localhost/
xfb7svmp

xfb7svmp1#

我不建议从用户文件夹提供服务。在C驱动器的根目录下创建一个新文件夹,然后从那里提供服务。还要确保您有被授予的访问权限。

DocumentRoot "/folder_one/folder_two"

<Directory "/folder_one/folder_two">

    Require all granted

</Directory>

相关问题