Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question
1  
Any specific reason you didn't install memcache via YUM –  GeekRide Dec 23 '12 at 5:33
    
None, I can go and try to reinstall using YUM. –  Jonas Kaufmann Dec 23 '12 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)... –  Jonas Kaufmann Dec 23 '12 at 5:49

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
I now have the extension "memcache" enabled and running. I hope it is the right one ;) –  Jonas Kaufmann Dec 23 '12 at 5:50
    
great ... that's awesome. –  GeekRide Dec 23 '12 at 5:51
    
$memcache = new Memcache; works, so I believe it is the right one. GREAT :) –  Jonas Kaufmann Dec 23 '12 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 '13 at 3:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.