在CentOS 5.6上安装PHP PECL memcached扩展

我想在我的服务器上设置memcached,以便我可以学习如何使用它。 这是我的理解,使用PHP的基本要求是:

  • PHP
  • memcached的
  • PHP的PECL memcached库

通过yum成功安装并运行php53 ,我试着运行

 yum install php-pecl-memcached 

以下是yum在尝试安装php-pecl-memcached时的一部分输出:

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

我需要坚持使用php 5.3所以我不能回到yum php包(PHP5.1)。

根据这个网站 ,似乎有一个名为php53u的软件包回购,但我不能使用该回购。

我也想避免从源代码安装。

在CentOS 5.6上安装PECL memcached扩展是否有解决scheme?

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 

rpm -qa | grep php输出 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 

安装php53u,然后安装php53u-pecl-memcache。 这对我有效。

你为什么不尝试

 pecl install memcached 

代替? 假设你已经安装了php-pear

那么,我可以这样做:

 # 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