Yii2部署中的权限问题

Yii2项目在Linux上部署报错:The directory is not writable by the Web process ...

原因是执行目录没有写权限,需要确认以下两个问题:

查看部分文件的读写权限是否打开,推荐查一下 chmod 和 chown这两命令解决

1 、网站目录是否属于 nginx的运行用户,假定nginx的运行目录是www,执行以下命令

chown -R www domain(web目录)

  

2、 nginx的运行用户对于报错目录是否有写权限

chmod +w www /www/domian/web/assets

  

可能需要修改的目录有:

chmod -R 777 /frontend/web/assets
chmod 666 /frontend/web/newfile.txt 
chmod 777 /frontend/runtime

  

你可能感兴趣的:(Yii2部署中的权限问题)