服务器上目录的权限
我的服务器中有一个文件夹,我需要在其中动态写入数据,并且数据也应该对查看者可见,尽管它们不会直接提供。
我将通过 PHP 添加这些文件中的数据并为其提供服务,
该文件夹的权限应该是什么?
如果我使用 777 以外的任何东西,它会在我的本地计算机上显示错误 [我是 root]
I got a folder in my server where i need to write data dynamically, and the data should be also visile to the viewers, though they will not be served directly.
I will add the data from those file by PHP and will server them,
What should be the permission for this folder ?
If i use anything other than 777 it shows an ERROR on my local machine [i'm root there]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该目录需要由运行 Apache 的用户拥有(或可写和可读)。用户可能是
apache
或www-data
或httpd
。找出 apache 用户,然后设置所有权:The directory needs to be owned (or writable and readable) by the user under which Apache runs. The user is likely to be something like
apache
orwww-data
orhttpd
. Find out the apache user and then set ownership:请确保您授予权限的文件夹没有凭据(密码文件),即图片文件夹或公开可用的文件。
777 权限意味着您授予该文件夹完全权限,包括 wright。所以在这种情况下 777 是强制性的,因为动态上传文件!
Please make sure your folder that you are giving permission have no credentials(password files) i.e pictures folder or publicly available files.
777 permission mean you are giving that folder full permissions including wright also. So in that case 777 is mandatory because dynamically upload files!