1

so I want to install memcached on my CentOS 5.8 server.

I followed this tutorial http://kb.liquidweb.com/install-memcached-on-centos-5/

The command

  netstat -ap | grep 11511

shows that memcached is running.

I have added

extension = memcached.so

to php.ini and restarted the Apache server.

I am also positive that I chose the right php.ini (verified by phpinfo();).

Yet, it still does not work, neither shows it up in phpinfo();


What am I doing wrong? Can you help, please?


EDIT: when I run

php

I get the following error:

Unable to load dynamic library '/usr/lib64/php/modules/memcached.so' - /usr/lib64/php/modules/memcached.so: cannot open shared object file: No such file or directory in Unknown on line 0
3
  • 1
    Any specific reason you didn't install memcache via YUM
    – Napster_X
    Dec 23, 2012 at 5:33
  • None, I can go and try to reinstall using YUM. Dec 23, 2012 at 5:35
  • Got it working using YUM. I think my main error is that someone somehow decided to sometimes name it "memecached" and sometimes name it "memecache" (I know these two are different, yet the first one needs to use MEMCACHE.SO)... Dec 23, 2012 at 5:49

1 Answer 1

2

Ok, so the problem here is that you are using different memcache for some different purpose.

The one which works with PHP is this one.

To use this, download it from the URL given and follow the below steps to install it.

  • Untar the tar ball.
  • phpize (if this is not installed, install it first)
  • ./configure
  • make && make install
  • cp modules/memcache.so /usr/lib64/php/modules/

Then restart the Web server. It should work.

Also, please remove any other memcache you have installe earlier, just to prevent any conflicts.

Also, I believe you can install the same through yum also with this command:

# yum install php-pecl-memcached

NB: This yum command will install pecl-memcached, however the php.net page linked above is for pecl-memcache. These are 2 different extensions, as noted in mit's comment on that page.

4
  • I now have the extension "memcache" enabled and running. I hope it is the right one ;) Dec 23, 2012 at 5:50
  • great ... that's awesome.
    – Napster_X
    Dec 23, 2012 at 5:51
  • $memcache = new Memcache; works, so I believe it is the right one. GREAT :) Dec 23, 2012 at 5:52
  • NB: This yum command will install pecl-memcached, however the php.net page linked above is for pecl-memcache. These are 2 different extensions, as noted in mit's comment on that page.
    – Forest
    Jan 16, 2013 at 3:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .