Welcome Guest, Not a member yet? Register   Sign In
Memcached session storage driver error
#1

Hello. Thanks for your Work.

I tried to use Memcached instead of database for Session storage (on  CodeIgniter 3.1.6):
PHP Code:
$config['sess_driver'] = 'memcached';
$config['sess_cookie_name'] = 'wsc_sessions';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'localhost:11211';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 7200;
$config['sess_regenerate_destroy'] = FALSE

But there was an error:
Warning: Uncaught Error: Class 'Memcached' not found in /system/libraries/Session/drivers/Session_memcached_driver.php:108 Stack trace: 
#0 [internal function]: CI_Session_memcached_driver->open('/var/lib/php/se...', 'wsc_sessions') 
#1 /system/libraries/Session/Session.php(143): session_start() 
#2 /system/core/Loader.php(1279): CI_Session->__construct() 
#3 /system/core/Loader.php(1172): CI_Loader->_ci_init_library('Session', 'CI_', NULL, 'session') 
#4 /system/core/Loader.php(1037): CI_Loader->_ci_load_stock_library('Session', 'Session/', NULL, NULL) 
#5 /system/core/Loader.php(1083): CI_Loader->_ci_load_library('Session', NULL, NULL) 
#6 /system/core/Loader.php(218): CI_Loader->_ci_load_library('Session', NULL, NULL) 
#7 /application/controllers/Wifi.php(11): CI_ in /system/libraries/Session/drivers/Session_memcached_driver.php on line 108 Fatal error: session_start(): Failed to initialize storage module: user (path: /var/lib/php/sessions) in /system/libraries/Session/Session.php on line 143
Reply
#2

(This post was last modified: 11-14-2017, 11:06 AM by InsiteFX.)

Well taking a guess I'll bet that you need to re-install CodeIgniter deleting the ./system folder.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Thanks for your reply.

I followed your advice and reinstalled the CodeIgniter 3.1.6 by deleting the ./system folder, but the error remained the same.

PS: I use the Memcached (with the path:localhost:11211for another project (CMS Bitrix24) on the same server, but there is no such error
Reply
#4

(11-14-2017, 11:05 AM)InsiteFX Wrote: Well taking a guess I'll bet that you need to re-install CodeIgniter deleting the ./system folder.

Dude, stop making guesses. If you don't know how to help, you don't have to reply.
The Memcached class is part of a PHP extension.

(11-14-2017, 11:30 AM)Andrey Wrote: Thanks for your reply.

I followed your advice and reinstalled the CodeIgniter 3.1.6 by deleting the ./system folder, but the error remained the same.

PS: I use the Memcached (with the path:localhost:11211for another project (CMS Bitrix24) on the same server, but there is no such error

On the same server? Really? There's three options:

1. It's not on the same server.
2. It's not Memcached, but Memcache (no 'd' at the end; different PHP extension).
3. That server has multiple PHP versions installed, or that other application uses a different PHP SAPI; either way - the one you're using with CI doesn't have Memcached enabled.
Reply
#5

(11-14-2017, 04:50 PM)Narf Wrote: On the same server? Really? There's three options:

1. It's not on the same server.
2. It's not Memcached, but Memcache (no 'd' at the end; different PHP extension).
3. That server has multiple PHP versions installed, or that other application uses a different PHP SAPI; either way - the one you're using with CI doesn't have Memcached enabled.

Um, actually there's a 4th option - that other app isn't running PHP at all.
Reply
#6

(11-14-2017, 04:50 PM)Narf Wrote: 2. It's not Memcached, but Memcache (no 'd' at the end; different PHP extension).

You're right: on the server php-memcache was installed but there was no php-memcached.
I fixed it and the error was gone.

Thank you for your help.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB