【发布时间】:2021-02-09 12:56:15
【问题描述】:
我在这里需要帮助。我在我的 RHEL 8 服务器中安装了 Laravel
但是我收到了这个错误。我知道这个问题已经发布了很多次,但我试图遵循这个建议,但到目前为止我没有运气。我不知道为什么。
The stream or file "/var/www/html/vpa/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied
sudo chown -R $USER:www-data storage
sudo chown -R $USER:www-data bootstrap/cache
sudo chmod -R 755 storage
sudo chmod -R 755 bootstrap/cache
sudo setenforce 0
sudo chcon -t httpd_sys_rw_content_t storage
php artisan config:clear
php artisan config:cache
composer dump-autoload
sudo systemctl restart httpd
sudo reboot
我这边似乎没有任何效果。我不知道还能做什么。请帮帮我
【问题讨论】:
-
我也面临这个问题。我在 Nginx 上运行我的应用程序。不管怎样,已经有一段时间了。你最终能自己解决吗?
-
我刚刚通过运行
setenforce 0解决了我的问题。 -
@KelvinLow。我在 RHEL8 中找到了解决方案。您需要将 chmod 设置为 775 以用于文件夹存储和引导/缓存而不是 755。是的,您需要 'setenforce 0'
-
很高兴知道。您介意回答自己的问题,以便其他人知道您的问题已得到解答吗?