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

Hey, I just wanted to add this as a reminder to myself, as I had trouble with it again on shared hosting...

Creating a sessions folder and doing this

Code:
$config['sess_save_path'] = 'sessions';

get's you an error like

Code:
A PHP Error was encountered
Severity: Warning

Message: touch(): open_basedir restriction in effect. File(sessions/ci_sessionre75b41fj6vnmkujqvfb8r6t75p4rb3l) is not within the allowed path(s): (/home/oulunosast/:/tmp/:/var/tmp/:/usr/local/php70/lib/:/usr/local/php54/lib/:/usr/local/php55/lib/:/usr/local/php56/lib/:/usr/local/php70/lib/:/usr/local/php71/lib/:/usr/local/php72/lib/:/usr/local/lib/php/)

Filename: drivers/Session_files_driver.php

Line Number: 248

Backtrace:

A PHP Error was encountered
Severity: Warning

Message: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (sessions)

Filename: Unknown

Line Number: 0

Backtrace:

Don't forget that absolute path, which can be achieved like so...

Code:
$config['sess_save_path'] = BASEPATH . 'sessions';

The warning error should disappear.

Goodbye future me Tongue
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 n2fole00 - 05-25-2018, 03:38 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