Home >Backend Development >PHP Tutorial >Solution to the general situation when PHP cannot obtain SESSION information

Solution to the general situation when PHP cannot obtain SESSION information

藏色散人
藏色散人forward
2019-10-10 14:22:122435browse

1. Check php.ini

vim /etc/php.ini

Check these items:

session.save_handler = files // session 的存储类型;
session.auto_start = 1 //是否自启动
session.save_path = "/var/tmp"  //存储位置

2. Check whether /var/tmp has read and write permissions, if not:

chmod 777 -R /var/tmp

3. Check the php-fpm configuration file

vim /etc/php-fpm.d/www.conf

Check these items:

php_value[session.save_handler] = files
php_value[session.save_path]    = /var/tmp
php_value[soap.wsdl_cache_dir]  = /var/tmp

Change to the same path as php.ini

Four , restart php-fpm

/bin/systemctl restart php-fpm.service

php Chinese network learning topic:php session (including pictures, videos, cases)

The above is the detailed content of Solution to the general situation when PHP cannot obtain SESSION information. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete
Previous article:php syntax error captureNext article:php syntax error capture