【发布时间】:2016-06-19 20:12:50
【问题描述】:
如何为 Laravel 4 设置存储目录权限。 我有这个错误:
`Error in exception handler: The stream or file "/var/www/mysite/app/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /var/www/mysite/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:84`
我已经 chmod -R 将存储目录改为 777。问题仍然存在。 有什么想法吗?
【问题讨论】:
-
你递归
chmod了吗?sudo chmod 777 -R storage -
是的,已确认。一切都变绿了:drwxrwxrwx。 2 apache apache 45 Mar 6 06:42 日志
-
看到这个,看起来很像stackoverflow.com/questions/23411520/…
-
好的,我发现这也发生在 joomla 上。我无法写入 configuration.php。它与网络服务器用户特权有关。顺便说一句,我使用的是 CentOS 7,其中 apache 作为网络用户。会尝试看看这个问题。
-
最后,它与 SELinux 的 CentOS 问题。这是解决方案:blog.lysender.com/2015/07/…