更新时间:2022-01-21 22:45:18
当保存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