更新时间:2021-08-04 21:24:32
当保存 php_session 的路径设置不正确时,这可能是一个问题:
This is a possible issue when the path to save php_session is not correctly set :
存储会话的目录不存在或php没有足够的写入权限.
The directory for storing session does not exists or php do not have sufficient rights to write to it.
要定义 php_session 目录,只需在 php.ini 中添加以下行:
To define the php_session directory simply add the following line to the php.ini :
session.save_path="/tmp/php_session/"
并赋予 http 服务器写入权限.
And give write rights to the http server.
通常,http 服务器作为组守护进程中的用户守护进程运行.如果是这种情况,以下命令将使其成功:
usually, the http server run as user daemon in group daemon. If it is the case, the following commands will make it :
chown -R :daemon /tmp/php_session
chmod -R g+wr /tmp/php_session
service httpd restart