Zend Server CE、daemon 的权限:daemon 在 OSX 上没有足够的权限
奇怪的是,服务器无法再调整图像大小,因为它没有足够的写入权限。当我检查要写入调整大小的图像的目录的权限时,我看到:
username Staff
执行 echo exec('whoami'); 后 并检查 httpd.conf 我看到服务器的用户和组是 daemon:daemon (这似乎是 OSX 安装上 Zend Server CE 的默认设置)。我应该怎么做才能再次拥有足够的权限。我应该将我的目录更改为 daemon:daemon (什么不起作用)。我应该更改服务器的用户还是其他什么?
Strangely enough the server can't resize images any more because it doesn't have enough write permissions. When I check the permissions of the directory I want to write my resized images to I see:
username staff
After excecuting echo exec('whoami');
and checking the httpd.conf I saw the user and group for the server was daemon:daemon (this seems to be the default for Zend Server CE on an OSX installation). What should I do so I have enough permissions again. Should I chown my directory to daemon:daemon (what isn't working). Should I change the user of the server or something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
恕我直言,接触 Web 服务器用户是没有意义的 - Apache 作为专用用户运行并且无权访问您的所有个人文件是有意义的。
根据我的经验,解决此问题的最佳方法是将文件的组更改为守护进程并使其可组写,但保留文件的所有者,以便您也可以编辑/删除它。在 OS X 终端上,这是通过以下方式完成的:
显然将
替换为您想要授予访问权限的文件的名称。另一种简单的方法是在文件上运行 chmod 666 - 使其可写,但如果您以任何方式关心安全性,则不建议这样做(在您自己的开发环境中可能没问题,但在生产或共享环境)。
IMHO there's no point in touching the web server user - it makes sense for Apache to run as a dedicated user and not have access to all your personal files.
The best way to solve this in my experience is to change the file's group to
daemon
and make it group-writable, but keep you the owner of the file so you can edit / delete it as well. On OS X terminal this is done by:Obviously replace
<file>
with the name of the file you want to give access to.Another easy way out is to run
chmod 666
on the file - make it world writable, but this is not recommended if you care about security in any way (might be ok on your own development environment but never in production or a shared environment).我真的取决于你是否在野外或私人生产中使用它。如果是我,我会简单地更改目录以仅用于服务器。如果您授予该组访问权限,您将可以访问更多内容。
I really depends on if you are using this in production in the wild or in private. If it were me, I would simply chown the directory for use with the server only. If you give access to that group, you will open up access to many more things.