---
# System prepended metadata

title: Linux遇到資料夾權限問題
tags: [' ubuntu', Linux]

---

---
tags: Linux, ubuntu
---
# Linux遇到資料夾權限問題

## 問題:
`laravel - The stream or file "/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied`

## 解法:
`sudo chown apache:apache -R dir`

`sudo chmod u+w,g+w -R dir`

或是

`sudo -u root bash -l`

`chown -R apache apache dir`

`chown apache.apache -R dir`

`chmod u+w,g+w -R hl`

## don't do that
![](https://i.imgur.com/LJSIE6T.gif)
