【发布时间】:2016-12-22 18:09:26
【问题描述】:
我的 Mac 上有一个新的 Laravel 5 项目。来自 github 的所有内容都已设置并且应该可以工作。运行此命令后,它实际上适用于http://localhost:8000/:
php artisan serv
但是,当我想使用虚拟主机时,在浏览器中键入 myprojectname.local 时出现 403 错误。
我在 Php 中有几个 noframework 项目,它们仍然运行良好,我可以使用 otherproject.local 通过我的浏览器 (Chrome) 运行它们因此我不认为 VirtualHosts 是原因。
我正在考虑一个授权问题,所以我检查了我的文件夹的所有者和组(/Users/username/Documents/foldername),但它们与 /private/etc/apache2/httpd.conf 中的配置相似见下文
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User username
Group staff
但是在 XAMPP 和 private/etc 中有太多的“httpd.conf”……我觉得有点失落。
在我的错误日志(我已经在调试模式下设置)这是我看到的:
[Fri Aug 12 16:15:34.606324 2016] [authz_core:debug] [pid 40647] mod_authz_core.c(809): [client ::1:52290] AH01626: authorization result of Require all denied: denied
[Fri Aug 12 16:15:34.606428 2016] [authz_core:debug] [pid 40647] mod_authz_core.c(809): [client ::1:52290] AH01626: authorization result of <RequireAny>: denied
[Fri Aug 12 16:15:34.606436 2016] [authz_core:error] [pid 40647] [client ::1:52290] AH01630: client denied by server configuration: /Users/username/Documents/foldername/public/
[Fri Aug 12 16:15:34.606527 2016] [authz_core:debug] [pid 40647] mod_authz_core.c(809): [client ::1:52290] AH01626: authorization result of Require all granted: granted
[Fri Aug 12 16:15:34.606533 2016] [authz_core:debug] [pid 40647] mod_authz_core.c(809): [client ::1:52290] AH01626: authorization result of <RequireAny>: granted
[Fri Aug 12 16:15:34.606591 2016] [charset_lite:debug] [pid 40647] mod_charset_lite.c(219): [client ::1:52290] AH01448: incomplete configuration: src unspecified, dst unspecified
[Fri Aug 12 16:15:34.607115 2016] [authz_core:debug] [pid 40647] mod_authz_core.c(809): [client ::1:52290] AH01626: authorization result of Require all granted: granted
[Fri Aug 12 16:15:34.607130 2016] [authz_core:debug] [pid 40647] mod_authz_core.c(809): [client ::1:52290] AH01626: authorization result of <RequireAny>: granted
[Fri Aug 12 16:15:34.607139 2016] [charset_lite:debug] [pid 40647] mod_charset_lite.c(219): [client ::1:52290] AH01448: incomplete configuration: src unspecified, dst unspecified
【问题讨论】:
标签: php laravel xampp apache2 httpd.conf