doudu9094 2015-03-21 04:58
浏览 2518
已采纳

Yii2 - 异常(无效配置)'yii \ base \ InvalidConfigException',带有消息'Web进程无法写入目录

When I access the site at domain.com/web, I'm displayed this error. I changed the directory permissions and they are listed below. Any solution?

PHP User Error – yii\base\ErrorException

Exception (Invalid Configuration) 'yii\base\InvalidConfigException' with message 'The directory is not writable by the Web process: /var/www/.../site1/web/assets' 

in /var/www/.../site1/vendor/yiisoft/yii2/web/AssetManager.php:168

Permissions:-

root@...:/var/www/.../site1# ls -l web
total 48
drwxrwxr-x 9 root root 4096 Mar 20 15:56 assets
drwxr-xr-x 2 root root 4096 Mar 20 15:50 css

root@...:/var/www/.../site1/assets# ls -l
total 8
-rw-r--r-- 1 root root 958 Mar 20 17:24 AppAsset.php
-rw-r--r-- 1 root root 628 Mar 20 17:24 error_log

Even after running this command:-

chmod -R 777 .

total 8
-rwxrwxrwx 1 root root 958 Mar 20 17:24 AppAsset.php
-rwxrwxrwx 1 root root 628 Mar 20 17:24 error_log

I'm still getting same error.

  • 写回答

2条回答 默认 最新

  • doucan9079 2015-03-21 05:08
    关注

    I had same issue few days back.

    If this was working earlier and suddenly got this error and stopped working than just restart your PC and check again. Else do the following.

    In order to make a directory writable by the webserver you have to set the directory's owner or group to Apache's owner or group and enable the write permission for it. Usually, we set the directory to belong to the Apache group and enable the write permission for the group.

    This worked for me.

    chgrp apache /path/to/yourdir
    chmod g+w /path/to/yourdir
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器