SoFunction
Updated on 2025-03-10

How to solve the general situation where PHP cannot obtain SESSION information

1. Check

vim /etc/

Check these items:

session.save_handler = files // The storage type of session;
session.auto_start = 1 // Whether to start
session.save_path = "/var/tmp" //Storage location

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//

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

4. Restart php-fpm

/bin/systemctl restart 

The above is the detailed content of the general solution for PHP's inability to obtain SESSION information. For more information, please pay attention to my other related articles!