Title: 2015-12-29-install-phpredis
Date: 2015-12-29
Author: ColinLiu
Category: PHP
tags: php,redis
Requirments
you need to install php and php-fpm before.
Installation
## git clone
git clone https://github.com/phpredis/phpredis.git
## install
root@pts/2 $ which phpize
/usr/bin/phpize
zabbix-server [~] 2015-12-29 15:05:44
root@pts/2 $ which php-config
/usr/bin/php-config
cd phpredis
# step1
/usr/bin/phpize or phpize
# step2
./configure --with-php-config=/usr/bin/php-config
# step3
make && make install
Configure
vim /etc/php.d
add "extension=redis.so" record
# check configure file
root@pts/2 $ cat /etc/php.d/redis.ini
extension=redis.so
To take effect
root@pts/2 $ ps -ef|grep php-fpm
apache 1334 12167 0 Dec28 ? 00:01:52 php-fpm: pool www
root 12167 1 0 Dec28 ? 00:00:04 php-fpm: master process (/etc/php-fpm.conf)
apache 12168 12167 0 Dec28 ? 00:02:01 php-fpm: pool www
apache 12169 12167 0 Dec28 ? 00:02:04 php-fpm: pool www
apache 12170 12167 0 Dec28 ? 00:02:12 php-fpm: pool www
apache 12171 12167 0 Dec28 ? 00:02:10 php-fpm: pool www
apache 12172 12167 0 Dec28 ? 00:02:03 php-fpm: pool www
apache 12178 12167 0 Dec28 ? 00:02:08 php-fpm: pool www
apache 13582 12167 0 Dec28 ? 00:02:03 php-fpm: pool www
root 31020 16150 0 15:12 pts/2 00:00:00 grep --color=auto php-fpm
zabbix-server [~] 2015-12-29 15:12:08
root@pts/2 $ kill 12167
# then try to execute to take effect
root@pts/2 $ php-fpm