CodeIgniter: Session: Configured save path '' is not a directory, doesn't exist

Started by Manish, January 12, 2017, 04:44:19 PM

Previous topic - Next topic

Manish

Hello,

Sometimes you get below errors on the CodeIgniter website.

QuoteA PHP Error was encountered

Severity: Warning

Message: mkdir(): Invalid path

Filename: drivers/Session_files_driver.php

Line Number: 117

Backtrace:

File: /home/user/public_html/index.php
Line: 295
Function: require_once
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/user/public_html/system/libraries/Session/drivers/Session_files_driver.php

Line Number: 119

Backtrace:

File: /home/user/public_html/index.php
Line: 295
Function: require_once
A PHP Error was encountered

Severity: Warning

Message: fopen(f7a5103144e842f8cafeb2355869ca11dd7ecf48): failed to open stream: Permission denied

Filename: drivers/Session_files_driver.php

Line Number: 156

Backtrace:

To fix the issue follow below steps:

1. Open the config.php file in the directory Codeigniter
2. Find the following code:

Quote$config['sess_save_path'] = NULL;

3. Change to:

Quote$config['sess_save_path'] = sys_get_temp_dir();

Your website should be working fine.

That's it  :)