Welcome Guest, Not a member yet? Register   Sign In
Setting sess_save_path correctly
#1

Hi, I've just uploaded my first ci app to my host provider's server after working on it in apache's localhost. The welcome controller worked fine, but when I tried to access my ion auth login, I got the following error...

Code:
A PHP Error was encountered

Severity: Warning

Message: mkdir(): Invalid path

Filename: drivers/Session_files_driver.php

Line Number: 117

Backtrace:

File: /home/leke/public_html/ci/application/core/MY_Controller.php
Line: 9
Function: library

File: /home/leke/public_html/ci/application/core/MY_Controller.php
Line: 52
Function: __construct

File: /home/leke/public_html/ci/application/controllers/admin/Dashboard.php
Line: 9
Function: __construct

File: /home/leke/public_html/ci/index.php
Line: 292
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/leke/public_html/ci/system/core/Exceptions.php:272)

Filename: core/Common.php

Line Number: 568

Backtrace:

An uncaught Exception was encountered

Type: Exception

Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created.

Filename: /home/leke/public_html/ci/system/libraries/Session/drivers/Session_files_driver.php

Line Number: 119

Backtrace:

File: /home/leke/public_html/ci/application/core/MY_Controller.php
Line: 9
Function: library

File: /home/leke/public_html/ci/application/core/MY_Controller.php
Line: 52
Function: __construct

File: /home/leke/public_html/ci/application/controllers/admin/Dashboard.php
Line: 9
Function: __construct

File: /home/leke/public_html/ci/index.php
Line: 292
Function: require_once

After a little googling, I found adding changing $config['sess_save_path'] from NULL to sys_get_temp_dir(); in config.php fixed the problem. Reading up on this led me to https://www.codeigniter.com/user_guide/l...sions.html and there it was suggested I load $this->load->library('session'); after parent::__construct() in MY_Controller. Trying this (after setting $config['sess_save_path'] back to NULL) gave me an error again, so I'm back to the sys_get_temp_dir(); as the value to $config['sess_save_path'].

So my question is, is this a usual thing when setting up the live app environment, or should I be concerned about something at this stage? As a noob, it's quite hard to ask questions about something I am new to, but I'm just trying to make sure I'm not going too far off track here while trying to understand as much as possible.

Thanks.
Reply


Messages In This Thread
Setting sess_save_path correctly - by n2fole00 - 03-05-2016, 08:45 AM
RE: Setting sess_save_path correctly - by Narf - 03-05-2016, 12:59 PM
RE: Setting sess_save_path correctly - by MikeDiz - 05-30-2018, 01:18 AM
RE: Setting sess_save_path correctly - by MikeDiz - 05-30-2018, 01:20 AM
RE: Setting sess_save_path correctly - by MikeDiz - 05-30-2018, 03:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB