• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI 2.1.4 and Memcached

I'm new to CI and this is my first post. I'm trying to make use of memcache and I'm having a difficult time.

My environment is CentOS using PHP 5.4.16 and Apache 2.2.24. I have memcached running on the standard port. I have mem_cache_module installed in apache, and PHP sees memcache libraries on phpinfo.

When I run the following:
public function cache() {
  $this->cache->memcached->save('foo', 'bar', 10);  


I get:

This is in the log:
ERROR - 2013-10-26 23:04:55 --> The Memcached Extension must be loaded to use Memcached Cache.

memcache & memcached are two different extensions to php. what you loaded in php is named 'memcache', and what ci needed is called 'memcached'

As it turns out on CentOS 6 and PHP 5.4 php-pecl-memcached is not an easily obtainable RPM. The php-pecl-memcache (note without the d) claims it supports memcached but through some testing outside of CI it turns out it doesn't.

I've decided to stop chasing this rabbit and use APC instead.

Dont forget to create memcached.php in /config folder when you use memcached in codeigniter
(For more detail you can read in http://ellislab.com/forums/viewthread/180005/#852413)

And you should care that memcache and memcached is difference

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.