yii2 - 所有文件和文件夹权限都搞砸了.yii2框架的目录层次应该是什么权限 [英] yii2 - All Files and Folders permissions are messed up. What should be the permissions of yii2 framework's directory hierarchy

查看:25
本文介绍了yii2 - 所有文件和文件夹权限都搞砸了.yii2框架的目录层次应该是什么权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 FileZilla 的帮助下将完整的 yii2 安装从一台服务器移到了另一台服务器.遗憾的是,Filezilla 默认不保留文件权限,现在我面临文件/目录权限问题.我想知道yii2目录层次结构中不同目录和文件的文件权限是什么.

I moved the complete yii2 installation from one server to another with the help of FileZilla. Sadly, Filezilla don't keep the file permissions by default, and now I'm facing issues with file / directory permissions. I would like to know what's the file permissions for different directories and files in the yii2 directory hierarchy.

推荐答案

您不应该以这种方式转移项目.

You should not transfer the project this way.

目前是版本控制(尤其是 Git)和 Composer 的时代.

Currently it's the era of version control (especially Git) and Composer.

在本地创建项目并将其置于版本控制之下后,将其推送到主存储库,然后将其部署到生产服务器.

Once you created you project locally and put it under version control, you push it to your main repository and then deploy it to production server.

不需要使用 Filezilla 或类似的东西.

No need to use Filezilla or something like that.

如果您的托管人限制了您,最好切换到另一个.

If your hoster limits you in that, it's better to switch to another one.

在您目前的情况下,手动比较和设置权限可能非常繁琐,某些权限是在 init 命令期间设置的.

In your current situation comparing and setting permissions manually can be very tidious, some of the permissions are set during init command.

所以我建议使用版本控制和 Composer 重新部署它,而不是手动设置权限.

So I recommend to deploy it again using version control and Composer instead of struggling with manual permissions setting.

但为了以防万一,我检查了生产服务器,大多数文件夹权限是 0755,对于文件 - 0644.runtimeassets 等文件夹具有 0777 权限,并使用我上面提到的 init 命令进行设置.

But just in case, I checked production server, most of the folder permissions are 0755, for files - 0644. Folders like runtime, assets have 0777 permissions and set with init command as I mentioned above.

在本地,我使用 Vagrant,这里的几乎所有内容都有 0777 权限.

Locally I use Vagrant and pretty much everything here has 0777 permission.

这篇关于yii2 - 所有文件和文件夹权限都搞砸了.yii2框架的目录层次应该是什么权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆