0

I cannot get memcached installed for the life of me on CentOS 5.5

yum install memcached says package doesn't exist

I have tried installing from source, as well as yum. Apparently memcached is running according to ps auxw, and I have the extension loaded in my php.ini file, but PHP is saying it's not installed... It's not showing up under phpinfo

Andrew Fashion
  • 1,635
  • 7
  • 22
  • 26

1 Answers1

1

Memcached and the Memcached PHP extension are not part of the standard CentOS repository.

You need to install something like the RPMForge repository to get the appropriate packages.

Instructions for installing RPMForge are here.

After that, the packages you're looking for are memcached and php-pecl-memcached, i.e.:

yum install memcached php-pecl-memcached

You may need to restart your webserver after installing this for the PHP extension to become active.

I'm assuming that you see the memcached process running because you installed from source and started it. You might want to "make uninstall" from your source tree before you install proper packages.

Rafiq Maniar
  • 1,120
  • 9
  • 15
  • Opinion: I recommend EPEL instead of RPMForge. http://fedoraproject.org/wiki/EPEL –  Dec 02 '10 at 01:03
  • I performed the make uninstall, and removed it, and went through the RPMForge steps and it said RPMforge was already installed. – Andrew Fashion Dec 02 '10 at 01:04
  • Ok - so if you run "rpm -qa | grep memcache" what results do you get? – Rafiq Maniar Dec 02 '10 at 01:11
  • php-pecl-memcache-2.2.3-1.el5_2 – Andrew Fashion Dec 02 '10 at 01:13
  • BTW, I appreciate the help! This has been driving me crazy all day... Can't get a hold of any good sysadmins... – Andrew Fashion Dec 02 '10 at 01:15
  • So that shows just the PHP extension installed. I'd remove that with "yum remove php-mecl-memcache", and try install both packages again. "yum install memcached php-pecl-memcache". If it shows memcached not found then try "yum search memcached" and see if it appears in the search results. – Rafiq Maniar Dec 02 '10 at 01:15
  • Okay, uninstall worked fine. And reinstalling all the packages worked fine, it found all 3. I rebooted apache though, and still isn't showing in php.ini. extension=memcache.so is in there as well. – Andrew Fashion Dec 02 '10 at 01:17
  • Here is the install success: – Andrew Fashion Dec 02 '10 at 01:18
  • Running Transaction Installing : libevent 1/4 Updating : php-pecl-memcache 2/4 Installing : memcached 3/4 Cleanup : php-pecl-memcache – Andrew Fashion Dec 02 '10 at 01:19
  • Installed: memcached.x86_64 0:1.4.5-1.el5 Dependency Installed: libevent.x86_64 0:1.4.13-1 Updated: php-pecl-memcache.x86_64 0:2.2.6-1.el5 Complete! – Andrew Fashion Dec 02 '10 at 01:20
  • Ok - so looks all good? "service memcached start" and "service apache2 restart" - and you should have it shown in phpinfo ? – Rafiq Maniar Dec 02 '10 at 01:44
  • Starts and stops just fine (didn't use to work this good), but it's still not showing in php.ini. :( – Andrew Fashion Dec 02 '10 at 01:52
  • works! nevermind, works!!! tahnk you!!! – Andrew Fashion Dec 02 '10 at 01:53
  • Now, since you've helped me this far, maybe I can ask you one last question. How do I set the port and all of that, so I can set my PHP script to use it now ;) thank you :D – Andrew Fashion Dec 02 '10 at 01:54
  • The config variables including port and memory limit are in /etc/memcached.conf or /etc/memcached/memcached.conf - I don't know how to configure PHP to use it though, not my area :) – Rafiq Maniar Dec 02 '10 at 01:59
  • If you are reading this in 2015, the package php-pecl-memcached does not exist. You can run :sudo yum list \*php-pecl\* which will tell you that the package you need is called php-pecl-memcache.x86_64 – Ryan May 06 '15 at 16:04