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

#1
[eluser]Unknown[/eluser]
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:
Code:
public function cache() {
  $this->load->driver('cache');
  $this->cache->memcached->save('foo', 'bar', 10);  
  var_dump($this->cache->memcached->is_supported());

}

I get:
Code:
bool(false)

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

#2
[eluser]dickfu[/eluser]
memcache & memcached are two different extensions to php. what you loaded in php is named 'memcache', and what ci needed is called 'memcached'

#3
[eluser]Unknown[/eluser]
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.

#4
[eluser]DuyK-DCT[/eluser]
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.