gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 01:02:39 25 4
gpt4 key购买 nike

我是菜鸟,正在学习 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com