Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Session: Configured save path 'C:\Windows\Temp' is not writable by the PHP process

Tags:

codeigniter

An uncaught Exception was encountered

Type: Exception

Message: Session: Configured save path 'C:\Windows\Temp' is not writable by the PHP process.

Filename: prm\system\libraries\Session\drivers\Session_files_driver.php

Line Number: 125

Backtrace:

File: \prm\application\controllers\login.php Line: 8 Function: __construct

File: \prm\index.php Line: 279 Function: require_once

Not able to fix this issue. please suggest how to fix this

like image 378
Manoj Avatar asked Sep 13 '16 14:09

Manoj


3 Answers

We are setting up 'C:\Windows\Temp' windows directory path to database ci_session table.

change the following in your config file.

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

to

$config['sess_driver']= 'database';
$config['sess_cookie_name']= 'mycookie';
$config['sess_expiration']= 0;
$config['sess_save_path']= 'ci_session';
$config['sess_match_ip']= FALSE;
$config['sess_time_to_update']= 300;
$config['sess_regenerate_destroy']= FALSE;
$config['sess_use_database']= TRUE;
$config['sess_expire_on_close']= TRUE;
$config['sess_table_name']= 'ci_session';
like image 148
Arafath Avatar answered Oct 24 '22 00:10

Arafath


Edit config.php

Location: application/config/config.php

Before

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

After

$sessDir = session_save_path();
$sessDir = "{$sessDir}/sessionPath";
is_dir($sessDir)?:mkdir($sessDir);

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = $sessDir;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

It's work for me

like image 21
Shamim Shaikh Avatar answered Oct 24 '22 01:10

Shamim Shaikh


In your application's config.php file search for $config['sess_save_path'] change its default value of sys_get_temp_dir() to another publicly accessible directory preferably not in the C: drive.

or you can set it globally in your php.ini file and call ini_get ('session.save_path'), but first make sure you have changed the default value of that option to a temp directory of your choice.

like image 21
megz Avatar answered Oct 24 '22 01:10

megz