My blog backend uses the phalcon framework. I used to use the php7.0 version, but today I changed it to php7.1, and suddenly I found that I couldn’t get the session data. I went to the official website to ask a question, and it was said that it was a session problem with php7.1.
One solution they gave me was to changesession.sid_length
from 32 to 40. After restarting php-fpm it still doesn't work.
I went online and searched for some information. There are very few people saying this. Please tell me how to solve this problem.
Problem solved. Permissions issue.
Because I installed it using yum. Then the php session is saved in
/var/lib/php/session/
,它的默认权限是apache
.Then because I used nginx as the WEB server, but I modified the permissions of php-fpm, but I did not modify the permissions of php to save the session directory,
As a result, the session cannot be written to due to permission issues.
Then use
chown
to grant permissions. That's it.See if the directory where you save the session has this Session? ? ?