Ubuntu18.04 安装redis 和 php7.2的redis扩展
安装redis
#安装sudo apt-get install redis-server#启动sudo service redis-server start1234
安装php的redis扩展
git clone -b php7 https://github.com/phpredis/phpredis.gitmv phpredis/ /etc/opt
cd /etc/opt/phpredis
phpize # 如果失败 则 sudo apt-get install php7.2-dev 再 phpize./configure
make && make install123456
sudo ln -s /etc/php/7.2/mods-available/redis.ini /etc/php/7.2/fpm/conf.d/20-redis.ini# 也可以直接 sudo vim /etc/php/7.2/fpm/conf.d/redis.ini 中写入 extension=redis.sosudo service php7.2-fpm restartsudo service nginx restart1234
可以去phpinfo() 看看 就会有redis了