Codeigniter Session: Configured save path is not a directory
Codeigniter 3.x
Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created.
配置文件config.php
中
$config['sess_save_path'] = NULL;
可以修改为
$config['sess_save_path'] = APPPATH.'sessions';
然后在 application
文件夹下 创建一个目录sessions
目录
[vagrant@centos application]# chmod 755 sessions
如果目录是放在 类似/home/waka/public_html
目录下并出现类似以下的情况
Configured save path `/home/waka/public_html/application/sessions` is not writable by the PHP process
需要给session
文件夹的拥有者为这个文件夹的所属linux系统用户
可以通过 groups
命令查看用户所属的用户组
[vagrant@centos application]# groups waka
waka: waka
[vagrant@centos application]# chown waka:waka sessions