簡體   English   中英

laravel centOS 8“日志文件無法在 append 模式下打開:無法打開 ZF7B44CFAFD19C5222ED7BZ9”

[英]laravel centOS 8 "log file could not be opened in append mode: failed to open stream: Permission denied”

通常在 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. 重新啟動系統

沒有任何工作。 該怎么做才能解決這個問題?

從項目根文件夾嘗試:

    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/

原來問題出在selinux

這對我有用

chcon -R -t httpd_sys_rw_content_t /path/to/log/directory

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM