CodeIgniter会话工作我的wamp服务器正常,但在线服务器不工作


CodeIgniter session work my wamp server properly, But online server does not work

现在,我已经开发了一个医疗CodeIgniter应用程序服务的网站。有一个聊天选项。对于这个聊天功能,我创建了Session。配置文件代码

$config['encryption_key'] = 'CoderSaiful';
$config['sess_cookie_name']     = 'ci_session';
$config['sess_expiration']      = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie']  = FALSE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']      = 'ci_sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update']  = 300;
自动加载文件代码:
$autoload['libraries'] = array('database','form_validation','session');

Controller chat.php文件代码:

function index(){
$user_data = $this->session->all_userdata();
$data['title'] = 'Live Chat';
$data['sub_title'] = 'Chat with each other and free';;
$this->load->model('options_m');
$data['menu']=  $this->options_m->menu(); 
$data['site_info']=  $this->options_m->site_info();
$this->load->view('template/header_with_menu_with_top',$data);
            if(isset($user_data[0])){
//enter code here
            }
            else{
                $this->load->view('chat/form');  
            }
        /*
        $this->load->view('chat/form');
        $this->load->model('chat_m');
        $data['chat'] = $this->chat_m->get_chat();
        */
        $this->load->model('chat_m');
        $data['chat'] = $this->chat_m->get_chat();
        $this->load->view('chat/live',$data);
        if(isset($user_data[0])){
              $this->load->view('chat/chat_form',$user_data);   
            }
        $this->load->view('includes/footer');
        //dump($data);
    }

我想,一切都是正确的,它工作正常,当我检查我的本地pc wamp服务器。但是当我上传到我的web服务器。它显示错误。这样的:

Severity: Warning <br>
Message: Cannot modify header information - headers already sent by (output started at /home/saifulbd/public_html/jessorepublichealth.com/application/controllers/chat.php:1)<br>
Filename: libraries/Session.php<br>
Line Number: 675<br>

现在我想得到一个很好的解决这个错误。

是否适用于您的本地开发平台

我看到你经常检查的两件事是

文件系统路径配置

。如果你有Htaccess

在你的语句中,你的FTP目录是
/home/saifulbd/public_html/ci_folder/

的wampp,只有

/www/ci_folder