Home  >  Article  >  php教程  >  php 安装redis扩展

php 安装redis扩展

WBOY
WBOYOriginal
2016-06-06 19:43:411984browse

大家可以去http://code.google.com/p/redis/downloads/list这个地址找最近的下载 wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz tar zxf redis-2.6.14.tar.gz cd redis-2.6.14 make make install 也可以不执行make install,可以自己建立redis

 

大家可以去http://code.google.com/p/redis/downloads/list这个地址找最近的下载
wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz
tar zxf redis-2.6.14.tar.gz && cd redis-2.6.14
make
make install
也可以不执行make install,可以自己建立redis管理目录,当然我喜欢让redis放在系统默认目录下.
cp redis.conf /etc/
vi /etc/redis.conf
daemonize no
daemonize yes
将no改为yes,让redis后台运行

获取php-redis扩展
wget -c http://pecl.php.net/get/redis-2.2.4.tgz
tar -zxvf redis-2.2.4.tgz
cd redis-2.2.4
/data/klj/php/bin/phpize
./configure --with-php-config=/data/klj/php/bin/php-config


编译失败缺少M4 autoconf
wget http://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz
tar -zxvf m4-1.4.17.tar.gz
cd m4-1.4.17
./configure
make
make install


wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar -zxvf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure
make && make install
cd ../redis-2.2.4

/data/klj/php/bin/phpize
./configure --with-php-config=/data/klj/php/bin/php-config
make && make install

cd /data/klj/php/lib/php/extensions/no-debug-non-zts-20131226/
修改配置文件 加入
vim /data/klj/php/etc/php.ini

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn