简体   繁体   English

在Codeigniter中禁用自动会话保存(将Codeigniter项目复制到共享主机)

[英]Disable automatic session save in Codeigniter (duplicating a Codeigniter project to shared hosting)

I have a running system on VPS server, but I need to make a copy of it on another shared hosting server. 我在VPS服务器上有一个正在运行的系统,但是我需要在另一台共享托管服务器上制作一个副本。 I have copied all files to new shared hosting server. 我已将所有文件复制到新的共享托管服务器。 But after running my system, I am getting exception: 但是在运行系统后,我得到了例外:

Session: Configured save path '' is not a directory, doesn't exist or cannot be created. 会话:配置的保存路径“”不是目录,不存在或无法创建。

How can I fix this? 我怎样才能解决这个问题?

As I am using Codeigniter 3 and PHP 5.6 version. 由于我正在使用Codeigniter 3和PHP 5.6版本。

In config/config.php 在config / config.php中

Replace: $config['sess_save_path'] = NULL; 替换:$ config ['sess_save_path'] = NULL;

With: $config['sess_save_path'] = sys_get_temp_dir(); 使用:$ config ['sess_save_path'] = sys_get_temp_dir();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM