Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Cache Question for memcached

Hi guys i found this error when trying to enabled memcached:
[21-Feb-2013 05:48:55 Asia/Manila] PHP Fatal error: Class 'Memcached' not found in /home/xxx/public_html/library/core/class.memcached.php on line 50

i have enabled these on config.php
$Configuration['Cache']['Enabled'] = TRUE;
$Configuration['Cache']['Method'] = 'memcached';
$Configuration['memcached']['Store'] = 'localhost';

Tagged:

Comments

  • businessdadbusinessdad Stealth contributor MVP

    Wild guess (I never used memcached): have you enabled the memcached PHP extension?

  • yep, here's a screenshot of phpmyinf()

  • 50sQuiff50sQuiff ✭✭
    edited February 2013

    Just to confuse things there are two PHP libraries: memcached and memcache. Vanilla can actually use both, but you want to use 'memcache' in both your Vanilla config and your PHP installation. The other one has a memory leak.

  • hi @50sQuiff right now i'm using this configuration.

    $Configuration['Cache']['Enabled'] = TRUE; $Configuration['Cache']['Method'] = 'memcache'; $Configuration['memcache']['Store'] = 'localhost';
    this one doesnt seem to produce error, i'm also thinking what this one does $Configuration['memcached']['Store'] = 'localhost'; or should i do any configurations on this one.

    i dont see any errors as of the moment., just curious though, how can i verify if memcache is working fine ?

  • businessdadbusinessdad Stealth contributor MVP

    @50sQuiff said:
    Just to confuse things there are two PHP libraries: memcached and memcache.

    Just when I thought that discussionscontroller and discussioncontroller were confusing enough...

  • @businessdad said:
    Just when I thought that discussionscontroller and discussioncontroller were confusing enough...

    :D

  • how can i verify if memcache is working fine ?

    Use this: http://livebookmark.net/journal/2008/05/21/memcachephp-stats-like-apcphp/

  • hi @50sQuiff

    i've verified, the memcache is not working, attached

  • LincLinc Detroit Admin

    The information here is incorrect. You want to use memcached, NOT memcache.

  • hi @Lincoln, yep i've tried both with d and without d , as stated on the original question above,

    i get this error log when i add it on config.php

    [21-Feb-2013 05:48:55 Asia/Manila] PHP Fatal error: Class 'Memcached' not found in /home/xxx/public_html/library/core/class.memcached.php on line 50

    i have verified with my hosting that memcached is installed properly. i even attached the php.ini information here to prove memcached is installed and running, im not sure what i've missed.

  • not there is a difference between the memcahe server, and the php classes.

    you want this installed
    http://pecl.php.net/package/memcached

    not
    http://php.net/manual/en/book.memcache.php

    @Lincoln that is defo the case for 2.1? becuase memcache work perfectly fine on 2.0 used it on several clients. I noticed memcached vanilla implementation was buggy in 2.0.

    This will be useful info for upgrading.

    grep is your friend.

  • LincLinc Detroit Admin

    @fr3em1nd As @x00 states, you can't just add a 'd' on the end, memcached is a different PHP library that you do not have installed.

    @x00 I wasn't aware we were ever supporting memcache. AFAIK, we've only ever used memcached. Support for memcache may have been accidental. Not sure; not my area.

  • fr3em1ndfr3em1nd ✭✭
    edited February 2013

    @x00 yep "memcache" is working on vanilla 2.0 but it creates huge number of files as cache, but if you have high amount of disk space it would be a good solution, but would still greatly decrease the performance since it'll delete the old file cache and replace it with a newer one if outdated, i find it impractical, on my point of view.

    @Lincoln right now i'm running on Vanilla 2.1 and would like to try out some caching tools such as "memcached" i have manually upgraded my version on my live site -- i took the risk since i really like the new features on vanilla 2.1(even though it's not officially released). I even upgraded my server's version to PHP 5.3 just to support vanilla 2.1. So far everything has been stable, ofcourse small bugs, and sent some bugs&issues in github. I'd like to make my site a warzone for bugs and errors and maybe a big gamble for me on being big guinea pig. V21 has been great i just only have THIS major issue though. if you like you can look at my site http://www.txtmyt.com , it's vanilla from inside out

  • @Lincoln, in that case your code comments in class.memcache.php and class.memcached.php are out of date.

  • To clarify, there is a code comment in library/core/class.memcached.php warning not to use it because of a memory leak in the libmemcached library.

    Obviously based on what Lincoln has said, this advice no longer stands. My server guru tells me that may have been a problem back in 2008 but not any more.

  • @fr3em1nd said:
    x00 yep "memcache" is working on vanilla 2.0 but it creates huge number of files as cache, but if you have high amount of disk space it would be a good solution, but would still greatly decrease the performance since it'll delete the old file cache and replace it with a newer one if outdated, i find it impractical, on my point of view.

    that sounds more like filecache

    grep is your friend.

  • I have played around with memcache and memcached, but I have removed it again as I wasn't sure about its configuration and our hoster (where the forum will finally be placed) doesn't support it anyway.

    Now the default configuration in 2.1b1 is

    $Configuration['Cache']['Enabled'] = TRUE;
    $Configuration['Cache']['Method'] = 'dirtycache';
    $Configuration['Cache']['Filecache']['Store'] = PATH_CACHE.'/Filecache';
    

    and I'm not entirely sure how Filecache, memcache and memcached are supposed to be configured properly.

    Isn't it supposed to be $Configuration['Cache']['Method'] = 'Filecache';?

    Can someone please post the proper cache configuration for memcache and memcached?

    @Lincoln said:
    I wasn't aware we were ever supporting memcache. AFAIK, we've only ever used memcached. Support for memcache may have been accidental. Not sure; not my area.

    Doesn't look like it's accidental, if there are library/core/class.memcache.php and library/core/class.memcached.php present.

  • I used these settings, and mine seems to be working, although I'll need to verify:

    $Configuration['Cache']['Enabled'] = TRUE;
    $Configuration['Cache']['Method'] = 'memcache';
    $Configuration['memcache']['Store'] = 'localhost:11211';
    
  • edited September 2013

    I am running CentOS 6.4 and installed the memcached back-end, and memcache (not memcached) php extension:

    1) yum install memcached

    2) [OPTIONAL] Edit /etc/sysconfig/memcached to allow more connections, larger cache, etc.

    3) service memcached start

    4) pecl install memcache

    That was all that was required on my machine.

Sign In or Register to comment.