1

I would like to setup memcached on my server so that I can learn how to use it. It is my understanding that the basic requirements to use it with PHP are:

  • PHP
  • memcached
  • PHP PECL memcached library

After successfully installing and running php53 via yum, I have tried running

yum install php-pecl-memcached

The following is a portion of the output from yum when trying to install php-pecl-memcached:

--> Processing Conflict: php53-common conflicts php-common

I need to stick with php 5.3 so I cannot fall back to the yum php package (php 5.1).

It seems that there was a IUS repo with a package named php53u, according to this site, but I can't use that repo.

I would also like to avoid installing from source.

Is there a solution out there for installing the PECL memcached extension on CentOS 5.6, with PHP 5.3?

Output of yum repolist:

    [~]$ yum repolist
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.wiredtree.com
     * epel: mirror.steadfast.net
     * extras: mirror.wiredtree.com
     * updates: mirrors.serveraxis.net
    repo id                                                                        repo name                                                                                                                 status
    base                                                                           CentOS-5 - Base                                                                                                           3,566
    chl                                                                            CHL Packages for Enterprise Linux 5 - x86_64                                                                                  8
    chl-source                                                                     CHL Packages for Enterprise Linux 5 - x86_64 - Source                                                                         0
    epel                                                                           Extra Packages for Enterprise Linux 5 - x86_64                                                                            6,720
    extras                                                                         CentOS-5 - Extras                                                                                                           235
    updates                                                                        CentOS-5 - Updates                                                                                                          225
    repolist: 10,754

Output of rpm -qa | grep php

    [~]$ rpm -qa | grep php
    php53-cli-5.3.3-1.el5_6.1
    php53-common-5.3.3-1.el5_6.1
    php53-5.3.3-1.el5_6.1
5
  • Looks like you are mixing up php-* with php53-*. Please show us the output of yum repolist and rpm -qa | grep php?
    – quanta
    Oct 3, 2011 at 2:48
  • @quanta - I just posted the output that you requested.
    – Mike Moore
    Oct 3, 2011 at 4:11
  • Why you would like to avoid installing from source? Also check out the @SparX's answer.
    – quanta
    Oct 3, 2011 at 4:20
  • @quanta - I don't think I'm mixing up php-* with php53-*. I have tried setup #1: installing php53-* with php-pecl-memcached, and setup #2: installing php-* with php-pecl-memcached. I am certain that setup #1 is not even supposed to work since php-pecl-memcached seems not to work with php53. Please correct me if I am wrong.
    – Mike Moore
    Oct 3, 2011 at 4:22
  • @quanta - I am still very new to package management and linux server admin. I am trying to stick to pre-compiled packages for now. If installing the PECL Memcached extension on CentOS 5 must be done from source, then I don't have a choice. But that is part of my question - is there a solution aside from installing from source. Thanks!
    – Mike Moore
    Oct 3, 2011 at 4:41

3 Answers 3

2

Install php53u and then install php53u-pecl-memcache. That worked for me.

1

Why don't you try

pecl install memcached

instead? Assuming you already have php-pear installed.

1
  • yum reports a conflict between php53-common (installed) and php-common (php-pear dependency?)
    – Mike Moore
    Oct 3, 2011 at 4:16
1

Well, I was able to do it this way:

# Install IUS repo
[~] wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-8.ius.el5.noarch.rpm
[~] rpm -Uvh  ius-release-1.0-8.ius.el5.noarch.rpm

# Install PHP 5.3
# This installs php53u-cli and php53u-common as well
[~] yum install php53u

# Install the PHP PECL Memcache extension!
[~] yum install php53u-pecl-memcache

# Restart spawn-fcgi (refreshes PHP instance)
[~] /etc/init.d/php_cgi restart
2
  • 1
    Well, in your question you said you can't use that repo and at last you had to depend on tat :) Also be aware that memcache & memcached are two different pecl extensions. So the functions may differ depending on the extension you are using.
    – SparX
    Oct 3, 2011 at 17:30
  • @SparX - Thanks! I did not catch that the two extensions are different. I think initially I was unable to use the IUS repo because I had a dead URL. I just needed to find an up-to-date one.
    – Mike Moore
    Oct 3, 2011 at 19:27

You must log in to answer this question.

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