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

泄露秘密 提交于 2020-01-14 22:45:39

问题


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


回答1:


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';



回答2:


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.



来源:https://stackoverflow.com/questions/39472209/session-configured-save-path-c-windows-temp-is-not-writable-by-the-php-proce

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!