会话目录权限 [英] Permission for session directory

查看:39
本文介绍了会话目录权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器面临一个问题,即 php 会话无法存储数据.现在,我将会话目录权限更改为 777.任何人都可以确认此权限是正确和安全的吗?

I am facing an issue with my server that php session is not able to store data. Now, I changed my session directory permission to 777. Can any one confirm that this permission is correct and secure?

推荐答案

正如用户 prehfeldt 所说,正确和安全"取决于上下文.重要的是,正如我从您的问题中了解到的,您已经自定义了保存 php 会话的目录.这是一个很好的做法,尤其是当您使用共享主机时.由于会话目录未放置在您的公共文件夹中(使其可供任何人访问),您设置的权限应该不成问题.

As user prehfeldt said, "correct and secure" depends on the context. The important thing is that as I understand from your question, you have customized the directory where php sessions are saved. This is a good practice, especially if you are on shared hosting. Since the sessions directory is not placed in your public folders (making it accessible to anyone), the permissions you set should not be a problem.

无论如何,所需的最低权限是代表服务器的用户的读/写权限(通常对于 apache apache 与所有者和组 www-data 一起运行,但所有 linux 服务器发行版可能并非如此).

Anyway, minimum permissions needed are read/write permissions for the user that represents the server (usually for apache apache runs with owner & group www-data, but this might not be the case with all linux servers distributions).

这篇关于会话目录权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆