PHP7.1 cannot obtain session data
迷茫
迷茫 2017-05-16 13:14:02
0
2
647

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_lengthfrom 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.

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all (2)
给我你的怀抱

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 usechownto grant permissions. That's it.

    漂亮男人

    See if the directory where you save the session has this Session? ? ?

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!