linux - Yii/Linux 上的 Web 进程权限

标签 linux permissions yii gii

我是菜鸟,正在学习 AWS 上的 Yii 教程。到目前为止,我已经能够启动并运行所有内容——包括 mysql 连接。但是现在我正在使用 Gii 代码生成工具来帮助创建一些模型类。这样做时,我收到以下错误:

generating models/User.php
            Unable to write the file '/var/www/html/blog/protected/models/User.php'.
done!

文档还告诉我:

Info: Because the code generator needs to save the generated code into files, it is
required that the Web process have the permission to create and modify the corresponding
 files. For simplicity, we may give the Web process the write permission to the whole
 /www/blog directory. Note that this is only needed on development machines when using Gii.

这对我来说很有意义,我理解应用于用户和组的 Linux 权限的基本逻辑......但不是进程。有人可以告诉我如何为 Gii 进程提供对 webroot(在我的例子中是:/var/www/html/blog/)目录的写权限吗?

最佳答案

我授予所有用户以递归方式读取、写入和执行 webapp 文件的权限。

$sudo chmod -R og=rwx webapp_folder

并解决了权限问题,但这可能不是最好的方法。

关于linux - Yii/Linux 上的 Web 进程权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11481799/

相关文章:

php - 在 yii 中对 CListView 进行排序

javascript - 如何通过 ajax 将 javascript 数组传递给 YII 操作

python - 知道要在 Linux 上终止哪个 Python 进程?

linux - Makefile 和 Shell 脚本 (Bash)

php - 获取当前 php 文件的目录,该文件自脚本开始运行以来可能已更改

查明服务是否以 SYSTEM 用户身份运行的正确方法

c# - 尝试在 ASP.NET 应用程序中读取/写入文件时出现权限问题

php - 从 PHP 运行 Linux 命令

php - Yii setFlash 与注销

java - 我已经使用 docker 构建了命令并且输出成功并且我无法打开本地主机 7604