如何解决PHP配置文件中 save_handler 修改不生效

2021040115225777491.jpg

1.修改/etc/php-fpm.conf,或者,/etc/php-fpm.d/*.conf,或者,/usr/local/php/etc/php-fpm.conf

; Set session path to a directory owned by process user  
;php_value[session.save_handler] = files  
;php_value[session.save_path] = /var/lib/php/session     
php_value[session.save_handler] = redis  
php_value[session.save_path] = "tcp://127.0.0.1:6379"

如果php-fpm.conf设置了save_handler,那么php.ini的配置就不会起作用。

2.php-fpm成为内置进程

[root@localhost workspace]# php-fpm -v  
PHP 5.3.3 (fpm-fcgi) (built: Dec 11 2013 03:32:01)  
Copyright (c) 1997-2012 The PHP Group  
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies    

[root@localhost workspace]# php-cgi -v  
PHP 5.3.3 (cgi-fcgi) (built: Dec 11 2013 03:28:11)  
Copyright (c) 1997-2010 The PHP Group  
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

推荐:《2021年PHP面试题大汇总(收藏)》《php视频教程》

hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » 如何解决PHP配置文件中 save_handler 修改不生效