1

I have errors in CI

Error Number: 2006

MySQL server has gone away

UPDATE `ci_sessions` SET `timestamp` = 1475160630 WHERE `id` = 'a0ee72450a40e6e030aa1f3c5b6e2db8b6efc2cf'

Filename: libraries/Session/drivers/Session_database_driver.php

Line Number: 243

and

Error Number: 2006

MySQL server has gone away

SELECT RELEASE_LOCK('a0ee72450a40e6e030aa1f3c5b6e2db8b6efc2cf') AS ci_session_lock

Filename: libraries/Session/drivers/Session_database_driver.php

Line Number: 367

I googled for solutions and find answer here

Codeigniter error session DB

Codeigniter error session DB

but above solution didnot worked for my problem.

here is my config.php

defined('BASEPATH') OR exit('No direct script access allowed');

$config['base_url'] = "";

$config['index_page'] = '';

$config['uri_protocol'] = '';

$config['url_suffix'] = '';

$config['language'] = 'english';

$config['charset'] = 'UTF-8';


$config['enable_hooks'] = FALSE;

$config['subclass_prefix'] = 'MY_';

$config['composer_autoload'] = FALSE;

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';


$config['allow_get_array'] = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';

$config['log_threshold'] = 0;


$config['log_path'] = '';

$config['log_file_extension'] = '';


$config['log_file_permissions'] = 0644;

$config['log_date_format'] = 'Y-m-d H:i:s';

$config['error_views_path'] = '';

$config['cache_path'] = '';


$config['cache_query_string'] = FALSE;

$config['encryption_key'] = '';


$config['sess_driver'] = 'database';
$config['sess_save_path'] = 'ci_sessions'; 
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 86400;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 86400;
$config['sess_regenerate_destroy'] = FALSE;

$config['cookie_prefix']    = '';
$config['cookie_domain']    = '';
$config['cookie_path']      = '/';
$config['cookie_secure']    = FALSE;
$config['cookie_httponly']  = FALSE;

$config['standardize_newlines'] = FALSE;

$config['global_xss_filtering'] = FALSE;

$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();

$config['compress_output'] = FALSE;

$config['time_reference'] = 'local';

$config['rewrite_short_tags'] = FALSE;

$config['proxy_ips'] = '';

1 Answer 1

1

I face the same problem once i solve it by editing the config file please try this

$config['sess_driver'] = 'database';
$config['sess_save_path'] = 'ci_sessions'; 
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 86400;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 86400;
$config['sess_regenerate_destroy'] = FALSE;

to

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 86400;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie']  = FALSE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']      = 'ci_sessions';
$config['sess_save_path'] = sys_get_temp_dir();
$config['sess_table_name']      = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
Sign up to request clarification or add additional context in comments.

3 Comments

thanks Jithin Kuriakose for you answer but above answer did not work for my problem i also share my config.php .Please help me
try this it would done the trick. Here it save as file inside of database
Great to heard that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.