Skip to content
Advertisement

Error Session File Driver in CodeIgniter 3

I am a new developer of CodeInger, last few month I had developed my project with PHP framework which is called CodeIgniter. So my problem was that when I tried to upgrade my project from version 2 to 3 I’ve found one concerning error which was about session.

Note: I am using Google Cloud Hosting.

Here is a message :

A PHP Error was encountered

Severity: Warning

Message: mkdir(): The local filesystem is readonly, mkdir failed

Filename: drivers/Session_files_driver.php

Line Number: 117

Backtrace:

File: /base/data/home/apps/s~chatomuk-staging/13.383916973498394810/index.php
Line: 292
Function: require_once

I have tries more than 3 hours to solve it but there was no answer.

could anyone tell me what is the problem ?

url : http://chatomuk-staging.appspot.com/

Advertisement

Answer

you need to set this two parameter in your config.php file

$config['sess_driver'] = 'database'; 
$config['sess_save_path'] = 'ci_sessions'; 
$config['sess_use_database'] = TRUE;

Before that you check you session table is exist or not in your database if not exist the create

CREATE TABLE IF NOT EXISTS ci_sessions ( session_id varchar(40) DEFAULT '0' NOT NULL, ip_address varchar(45) DEFAULT '0' NOT NULL, user_agent varchar(120) NOT NULL, last_activity int(10) unsigned DEFAULT 0 NOT NULL, user_data text NOT NULL, PRIMARY KEY (session_id), KEY last_activity_idx (last_activity) );
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement