CentOS 6.5 下安装php-memcache扩展

环境:CentOS 6.5 64bit


1.在yum上查找安装包

[root@localhost ~]# yum list | grep php
php.x86_64                                   5.3.3-49.el6                @base
php-cli.x86_64                               5.3.3-49.el6                @base
php-common.x86_64                            5.3.3-49.el6                @base
php-devel.x86_64                             5.3.3-49.el6                @base
php-intl.x86_64                              5.3.3-49.el6                @base
php-mysql.x86_64                             5.3.3-49.el6                @base
php-pdo.x86_64                               5.3.3-49.el6                @base
php-pear.noarch                              1:1.9.4-5.el6               @base
php-soap.x86_64                              5.3.3-49.el6                @base
php-tidy.x86_64                              5.3.3-49.el6                @base
cups-php.x86_64                              1:1.4.2-78.el6_9            updates
graphviz-php.x86_64                          2.26.0-10.el6               base
php-bcmath.x86_64                            5.3.3-49.el6                base
php-dba.x86_64                               5.3.3-49.el6                base
php-debuginfo.x86_64                         5.3.3-49.el6                debug
php-embedded.x86_64                          5.3.3-49.el6                base
php-enchant.x86_64                           5.3.3-49.el6                base
php-fpm.x86_64                               5.3.3-49.el6                base
php-gd.x86_64                                5.3.3-49.el6                base
php-imap.x86_64                              5.3.3-49.el6                base
php-ldap.x86_64                              5.3.3-49.el6                base
php-mbstring.x86_64                          5.3.3-49.el6                base
php-odbc.x86_64                              5.3.3-49.el6                base
php-pecl-apc.x86_64                          3.1.9-2.el6                 base
php-pecl-apc-debuginfo.x86_64                3.1.9-2.el6                 debug
php-pecl-apc-devel.i686                      3.1.9-2.el6                 base
php-pecl-apc-devel.x86_64                    3.1.9-2.el6                 base
php-pecl-memcache.x86_64                     3.0.5-4.el6                 base
php-pecl-memcache-debuginfo.x86_64           3.0.5-4.el6                 debug
php-pgsql.x86_64                             5.3.3-49.el6                base
php-process.x86_64                           5.3.3-49.el6                base
php-pspell.x86_64                            5.3.3-49.el6                base
php-recode.x86_64                            5.3.3-49.el6                base
php-snmp.x86_64                              5.3.3-49.el6                base
php-xml.x86_64                               5.3.3-49.el6                base
php-xmlrpc.x86_64                            5.3.3-49.el6                base
php-zts.x86_64                               5.3.3-49.el6                base
php54-php-debuginfo.x86_64                   5.4.16-22.el6.centos.alt    debug
php54-php-pecl-apc-debuginfo.x86_64          3.1.15-0.4.20130912.el6.centos.alt
php54-php-pecl-memcache-debuginfo.x86_64     3.0.8-3.el6.centos.alt      debug
php54-php-pecl-zendopcache-debuginfo.x86_64  7.0.2-4.el6.centos.alt      debug
rrdtool-php.x86_64                           1.3.8-10.el6                base
uuid-php.x86_64                              1.6.1-10.el6                base
2.安装php-pecl-memcache

[root@localhost ~]# yum install php-pecl-memcache
[root@localhost ~]# rpm -qi php-pecl-memcache
Name        : php-pecl-memcache            Relocations: (not relocatable)
Version     : 3.0.5                             Vendor: CentOS
Release     : 4.el6                         Build Date: Fri 22 Jun 2012 04:28:17 PM CST
Install Date: Tue 23 Jan 2018 01:27:15 PM CST      Build Host: c6b8.bsys.dev.centos.org
Group       : Development/Languages         Source RPM: php-pecl-memcache-3.0.5-4.el6.src.rpm
Size        : 167457                           License: PHP
Signature   : RSA/SHA1, Mon 25 Jun 2012 06:20:10 AM CST, Key ID 0946fca2c105b9de
Packager    : CentOS BuildSystem 
URL         : http://pecl.php.net/package/memcache
Summary     : Extension to work with the Memcached caching daemon
Description :
Memcached is a caching daemon designed especially for
dynamic web applications to decrease database load by
storing objects in memory.

This extension allows you to work with memcached through
handy OO and procedural interfaces.

Memcache can be used as a PHP session handler.
[root@localhost ~]# rpm -ql php-pecl-memcache
/etc/php.d/memcache.ini
/usr/lib64/php/modules/memcache.so
/usr/share/doc/php-pecl-memcache-3.0.5
/usr/share/doc/php-pecl-memcache-3.0.5/CHANGELOG
/usr/share/doc/php-pecl-memcache-3.0.5/CREDITS
/usr/share/doc/php-pecl-memcache-3.0.5/LICENSE
/usr/share/doc/php-pecl-memcache-3.0.5/README
/usr/share/doc/php-pecl-memcache-3.0.5/example.php
/usr/share/doc/php-pecl-memcache-3.0.5/memcache.php
/usr/share/pear/.pkgxml/php-pecl-memcache.xml
重启Apache:

[root@localhost ~]# service httpd restart
3.检查php-memcache扩展是否安装成功

在网站目录下新建一个phpinfo.php测试页面,写上下面代码,保存。

 
在浏览器中打开phpinfo.php 会看到如下的信息,说明php-memcache扩展已经安装成功。

CentOS 6.5 下安装php-memcache扩展_第1张图片

你可能感兴趣的:(PHP)