Linux 下安装redis添加redis拓展

下载安装redis
wget http://download.redis.io/releases/redis-5.0.4.tar.gz
tar xzvf redis-5.0.4.tar.gz 
cd redis-5.0.4
make
cd src/
make install PREFIX=/usr/local/redis

mkdir /usr/local/redis/etc
cd redis-5.0.4
cp redis.conf /usr/local/redis/etc/
vi redis.conf 
修改:daemonize yes
vi /etc/rc.local 
//添加开机启动:
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf 
检查redis是否正常启动
ps -ef | grep -i redis
下载安装phpredis
git clone https://github.com/phpredis/phpredis 
cd phpredis/
phpize 
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
添加 redis.so拓展
service php-fpm restart

 

你可能感兴趣的:(服务器)