laravel centOS 8“日志文件无法以附加模式打开:无法打开流:权限被拒绝”

Ves*_*shi 2 selinux laravel centos8

通常在 ubuntu 中更改所有权www-data775权限可以解决此问题。但在 centos 8 中这似乎还不够。我所做的是——

  1. 将 SELinux 设置为宽容模式
  2. 允许写入 laravel 存储文件夹 - chcon -R -t httpd_sys_rw_content_t storage
  3. sudo chown -R nginx:nginx /path/to/your/laravel/root/directory
  4. chmod -R 775 存储/
  5. 重新启动系统

什么都不起作用。该怎么办才能解决这个问题呢?

jer*_*edy 7

从项目根文件夹尝试:

    sudo chmod -R gu+w storage/
    sudo chmod -R guo+w storage/
    sudo chmod -R gu+w bootstrap/cache/
    sudo chmod -R guo+w bootstrap/cache/
Run Code Online (Sandbox Code Playgroud)