找到正在尝试创建目录的用户
您好,我正在使用 cakePHP 的烘焙控制台来创建 cakePHP 应用程序。但是当我运行脚本时,它说当前用户无权在目录中创建文件夹。因此,为了找出被拒绝的用户,我从 PHP 脚本中回显了 whoami
并获取了该用户。现在我使该用户成为该目录的所有者。作为检查,我什至从终端在该目录上创建了文件夹。但是当脚本通过 PHP 运行时,它会在终端上显示错误,指出用户没有权限。
问题可能是什么?
Hello I am using cakePHP's bake console to create a cakePHP application. But when I run the scripts, it says that the present user does not have permission to create a folder in the directory. So to find out the user who is being denied, I echoed whoami
from the PHP script, and got the user. Now I made that user the owner of the directory. And as a check I even created folders on that directory from the terminal. But when the script runs via PHP, it spits the error on the terminal saying the user does not have permission.
What could the problem be?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Ubuntu 上,确保文件夹的所有者和组都是
www-data
。在开发阶段,我也倾向于将权限设为777或755。On Ubuntu, ensure that the owner and group of the folders are both
www-data
. During the development phase, I also tend to make the permissions 777 or 755.