Welcome Guest, Not a member yet? Register   Sign In
Using Memcached for session
#1
Smile 

Hello everybody  [Image: smile.gif]

I want to use memcache  for saving sessions. when i use pure PHP sessions code correctly work, but when i use CI we gave this error :

------------------------------------------------------------------
Fatal error: Class 'Memcached' not found in C:\laragon\www\system\libraries\Session\drivers\Session_memcached_driver.php on line 108
A PHP Error was encountered
Severity: Error
Message: Class 'Memcached' not found
Filename: drivers/Session_memcached_driver.php
Line Number: 108
Backtrace:


-------------------------------------------------------------
application/config.php
//session config
$config['sess_driver'] = 'memcached';
$config['sess_save_path'] = 'tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15';

//application/memcached.php
$config = array(

                  'default' => array(

                  'hostname' => '127.0.0.1',

                  'port'     => '11211',

                  'weight'   => '1',

                  ),
               );
-------------------------------------------------------
//php.ini setting
session.save_handler = memcache   
session.save_path="tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
-------------------------------------------------------
//controller
public function index()

{

            //session_start();           //correctly work

           //$_SESSION['favcolor'] = 'green';

           $this->load->view('welcome_message');       
}
-------------------------------------------------------

How can  i fix that ?

Thanks guys
Reply
#2

(This post was last modified: 06-02-2016, 08:48 AM by mwhitney.)

(06-02-2016, 07:41 AM)behrooz1x Wrote: //php.ini setting
session.save_handler = memcache   

This is the php.ini setting for memcache, not memcached. To use the CI session handler, you need to install memcached.
Reply
#3

(06-02-2016, 08:48 AM)mwhitney Wrote:
(06-02-2016, 07:41 AM)behrooz1x Wrote: //php.ini setting
session.save_handler = memcache   

This is the php.ini setting for memcache, not memcached. To use the CI session handler, you need to install memcached.

Thanks , so much.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB