Home  >  Article  >  Backend Development  >  Problem setting up multi-level directory sessions in php

Problem setting up multi-level directory sessions in php

高洛峰
高洛峰Original
2016-11-30 11:12:50937browse

Find session.save_path in php.ini and set the value to session.save_path = '3;/tmp/session'; to enable the third-level directory to save the session. However, php will not automatically generate the directory structure. At this time, you can use mod_files.sh in the ext/session directory of the source code package to generate the directory

$ bash mod_files.sh /tmp/session 3

After the generation is completed, it is found that the session still cannot be generated. After struggling for a long time, I discovered the mystery when I opened mod_files.bat. It turns out that I need to bring a parameter later, which corresponds to session.hash_bits_per_character in php.ini. This value defaults to 4, and the default configuration of the development and production versions is 5, so I use The following command regenerates the directory

$ bash mod_files.sh /tmp/session 3 5

Finally you can log in.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn