我是一个noob并在AWS上运行Yii教程。到目前为止,我已经能够启动和运行所有的东西 - 包括mysql连接。但是现在我正在使用Gii代码生成工具来帮助创建一些模型类。在此过程中,我发现了以下错误:Yii/Linux上的Web进程权限
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 /)目录吗?
后执行想补充一点,我已阅读并理解在生产服务器上运行Gii的危险。但是,config/main.php文件中的ip过滤器设置被设置为只允许从我的公共IP地址运行Gii。因此,运行一个实时的AWS实例(而不是WAMP本地主机)似乎仍然是安全的。 – 2012-07-14 07:22:03
进一步更新:我犯了一个错误,试图快速修复,但没有正确理解它,并做了... chmod -R 0644/var/www/html/blog/...我现在无法访问页面,这意味着我已经关闭应用程序。 ... 帮帮我!! – 2012-07-14 07:37:26
套'755'。 '进程'不需要权限,脚本在这种情况下是'Gii'。但是,如果apache在文件夹上有读/写/执行权限(7),它应该可以工作,并允许你在'Gii'配置文件中添加你的IP。 – adamors 2012-07-14 11:37:50