# Yii2 报错 The directory is not writable by the Web process:/home/htdocs/app/web/assets

**URL:** https://www.shiqidu.com/t/topic/440
**Category:** 开发调优
**Tags:** Yii
**Created:** [2018 年6 月 14 日 07:55 UTC](https://www.shiqidu.com/t/topic/440 "2018-06-14T07:55:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### 作者： ![yeqiu](https://www.shiqidu.com/user_avatar/www.shiqidu.com/yeqiu/32/14_2.png) [@yeqiu](https://www.shiqidu.com/u/yeqiu)
#### 发布日期： [2018 年6 月 14 日 07:55 UTC](https://www.shiqidu.com/t/topic/440/1 "2018-06-14T07:55:24Z")

</div>

这个报错是由目录权限导致的，你可以尝试下面的操作

```bash
ps -ef | grep apache | grep -v grep

```

这行命令会告诉你apache用户的名字

大多数情况下是`www:data`

然后进入到`/home/htdocs/app/web`目录下，执行下面的的代码

```bash
sudo chgrp www-data ./assets

sudo chmod g+w ./assets/

```

然后再试试问题应该解决了。
