php - facing error as soon as I load session library in my codeigniter 3.0.4 controller -
i have seen , checked other stackoverflow questions , common answer problem
make sure there's no whitespace before
<?php
tag
even after browsing other blogs , articles regarding issue, still facing same error. if remove load of session, works normal.
my error:
a php error encountered severity: warning message: mkdir() [function.mkdir]: no such file or directory filename: drivers/session_files_driver.php line number: 117 backtrace: file: /home/content/97/8248497/html/dvjtest/application/controllers/home.php line: 9 function: library file: /home/content/97/8248497/html/dvjtest/index.php line: 292 function: require_once php error encountered severity: warning message: cannot modify header information - headers sent (output started @ /home/content/97/8248497/html/dvjtest/system/core/exceptions.php:272) filename: core/common.php line number: 568 backtrace: uncaught exception encountered type: exception message: session: configured save path '' not directory, doesn't exist or cannot created. filename: /home/content/97/8248497/html/dvjtest/system/libraries/session/drivers/session_files_driver.php line number: 119 backtrace: file: /home/content/97/8248497/html/dvjtest/application/controllers/home.php line: 9 function: library file: /home/content/97/8248497/html/dvjtest/index.php line: 292 function: require_once
my controller:
<?php defined('basepath') or exit('no direct script access allowed'); class home extends ci_controller { public function __construct() { parent::__construct(); $this->load->library('session'); $this->load->helper('url'); $this->load->helper('cookie'); } public function index() { $this->load->view('header'); $this->load->view('welcome_message'); $this->load->view('footer'); } } ?>
session library trying write disk happens involved mkdir() well. need either make path writeable or change session data directory else writeable.
check "sess_save_path" in configs. more documentation on session configs: https://www.codeigniter.com/user_guide/libraries/sessions.html#session-preferences
Comments
Post a Comment