原因:yii \ base \ ErrorException mkdir():权限被拒绝-YII2

时间:2019-04-03 07:11:42

标签: php yii2

我遇到了这个例外。我该如何解决?

Exception – yii\base\Exception
Failed to create directory "/var/www/html/sitr/runtime/cache": mkdir(): Permission denied
↵
Caused by: yii\base\ErrorException
mkdir(): Permission denied
in /var/www/html/site/vendor/yiisoft/yii2/helpers/BaseFileHelper.php at line 624

2 个答案:

答案 0 :(得分:1)

  sudo chmod -R 775 /var/www/html/sitr/runtime

运行时文件夹不断生成文件,允许它这样做。

答案 1 :(得分:-1)

sudo chmod 777 -R /var/www/html/sitr/runtime