centos php memcache扩展,centos下安装PHP的memcache扩展

Title: 2015-12-29-install-phpmemcache

Date: 2015-12-29

Author: ColinLiu

Category: Memcache

tags: php,memcache

Requirments

yum install zlib

yum install libevent

Installation

root@pts/2 $ yum install php-pecl-memcache

Loaded plugins: fastestmirror

Zabbix | 951 B 00:00:00

base | 3.6 kB 00:00:00

epel/x86_64/metalink | 3.6 kB 00:00:00

epel | 4.3 kB 00:00:00

extras | 3.4 kB 00:00:00

mongodb | 951 B 00:00:00

nginx | 2.9 kB 00:00:00

remi-safe | 2.9 kB 00:00:00

rundeck-release-bintray | 1.3 kB 00:00:00

updates | 3.4 kB 00:00:00

remi-safe/primary_db | 328 kB 00:00:25

Determining fastest mirrors

* base: mirrors.yun-idc.com

* epel: mirrors.yun-idc.com

* extras: mirrors.yun-idc.com

* remi-safe: mirror5.layerjet.com

* updates: mirrors.yun-idc.com

Resolving Dependencies

--> Running transaction check

---> Package php-pecl-memcache.x86_64 0:3.0.8-4.el7 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================

Package Arch Version Repository Size

=============================================================================================================================================================================================

Installing:

php-pecl-memcache x86_64 3.0.8-4.el7 base 67 k

Transaction Summary

=============================================================================================================================================================================================

Install 1 Package

Total download size: 67 k

Installed size: 171 k

Is this ok [y/d/N]: y

Downloading packages:

php-pecl-memcache-3.0.8-4.el7.x86_64.rpm | 67 kB 00:00:00

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Installing : php-pecl-memcache-3.0.8-4.el7.x86_64 1/1

Verifying : php-pecl-memcache-3.0.8-4.el7.x86_64 1/1

Installed:

php-pecl-memcache.x86_64 0:3.0.8-4.el7

Complete!

zabbix-server [~] 2015-12-29 15:27:36

## After install you can execuate `updatedb` and then locate memcache.so if exist

root@pts/2 $ updatedb

zabbix-server [~] 2015-12-29 15:27:43

root@pts/2 $ locate memcache.so

/usr/lib64/httpd/modules/mod_socache_memcache.so

/usr/lib64/php/modules/memcache.so

## edit configure and add memcache.so in /etc/php.d/memcache.ini

root@pts/2 $ vim /etc/php.d/memcache.ini

zabbix-server [~] 2015-12-29 15:28:09

root@pts/2 $ head -2 /etc/php.d/memcache.ini

; ----- Enable memcache extension module

extension=memcache.so

zabbix-server [~] 2015-12-29 15:28:22

## To take effect, kill and start

root@pts/2 $ ps -ef|grep php-fpm

apache 1334 12167 0 Dec28 ? 00:01:55 php-fpm: pool www

root 8408 16150 0 15:28 pts/2 00:00:00 grep --color=auto php-fpm

root 12167 1 0 Dec28 ? 00:00:05 php-fpm: master process (/etc/php-fpm.conf)

apache 12168 12167 0 Dec28 ? 00:02:03 php-fpm: pool www

apache 12169 12167 0 Dec28 ? 00:02:05 php-fpm: pool www

apache 12170 12167 0 Dec28 ? 00:02:14 php-fpm: pool www

apache 12171 12167 0 Dec28 ? 00:02:12 php-fpm: pool www

apache 12172 12167 0 Dec28 ? 00:02:06 php-fpm: pool www

apache 12178 12167 0 Dec28 ? 00:02:09 php-fpm: pool www

apache 13582 12167 0 Dec28 ? 00:02:04 php-fpm: pool www

zabbix-server [~] 2015-12-29 15:28:40

root@pts/2 $ kill 12167

zabbix-server [~] 2015-12-29 15:28:43

root@pts/2 $ ps -ef|grep php-fpm

root 8456 16150 0 15:28 pts/2 00:00:00 grep --color=auto php-fpm

zabbix-server [~] 2015-12-29 15:28:45

root@pts/2 $ php-fpm

zabbix-server [~] 2015-12-29 15:28:49

root@pts/2 $ ps -ef|grep php-fpm

root 8499 1 0 15:28 ? 00:00:00 php-fpm: master process (/etc/php-fpm.conf)

apache 8500 8499 0 15:28 ? 00:00:00 php-fpm: pool www

apache 8501 8499 0 15:28 ? 00:00:00 php-fpm: pool www

apache 8502 8499 7 15:28 ? 00:00:00 php-fpm: pool www

apache 8503 8499 0 15:28 ? 00:00:00 php-fpm: pool www

apache 8504 8499 0 15:28 ? 00:00:00 php-fpm: pool www

root 8528 16150 0 15:28 pts/2 00:00:00 grep --color=auto php-fpm

Additional

memcache VS memcached

Refer to

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值