下載最新版php
wget http://download.redis.io/redis-stable.tar.gz
解壓編譯
nginx
tar zxvf redis-2.4.17.tar.gz cd redis-2.4.17 make make PREFIX=/usr/local/webserver/redis install
配置redisgit
mkdir /etc/redis cp redis.conf /etc/redis/redis.conf mkdir /var/lib/redis
拷貝命令文件
github
cp redis-server /usr/local/bin/ cp redis-cli /usr/local/bin/
修改配置信息web
# 而後新建目錄,存放配置文件 mkdir /etc/redis mkdir /var/redis mkdir /var/redis/log mkdir /var/redis/run mkdir /var/redis/6379 # 在redis解壓根目錄中找到配置文件模板,複製到以下位置。 cp redis.conf /etc/redis/6379.conf # 經過vim命令修改 daemonize yes #介個是設置服務在後臺運行 pidfile /var/redis/run/redis_6379.pid logfile /var/redis/log/redis_6379.log dir /var/redis/6379 8.redis-server /etc/redis/6379.conf 運行redis
git clone:redis
git clone https://github.com/phpredis/phpredis.git
訪問:https://github.com/phpredis/phpredis shell
切換分支:vim
git checkout -b php7 origin/php7
檢查PHP擴展
php7
/usr/local/php7/bin/phpize
創建編譯鏈接php-fpm
./configure --with-php-config=/usr/local/php7/bin/php-config
make
make
make test
make test
安裝
make install
檢查so文件
cd /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/ ls
修改php.ini
vi /usr/local/php7/etc/php.ini
添加:extension="redis.so"
sudo service nginx restart sudo /etc/init.d/php-fpm restart
……