Homestead PHP7安装phpredis扩展

sudo mkdir /home/phpredis/ && cd /home/phpredis/
sudo git clone -b php7 https://github.com/phpredis/phpredis.git

cd phpredis

sudo phpize

 sudo ./configure
 sudo make
 sudo make install


|模块导入php配置

  •  创建redis.ini
sudo vim /etc/php/7.0/mods-available/redis.ini
# 然后在这个文件中写入`extension=redis.so` 保存,退出
  •  引入redis.ini
cd /etc/php/7.0/fpm/conf.d
sudo ln -s /etc/php/7.0/mods-available/redis.ini 25-redis.ini
sudo ln -s /etc/php/7.0/mods-available/redis.ini /etc/php/7.0/cli/conf.d/redis.ini #绝对路径
  • 重启php-fpm
sudo /etc/init.d/php7.0-fpm reload
  • 验证
php -r "if (new Redis() == true){ echo \"OK \r\n\"; }"

感谢作者:https://nil.sh/homestead-installing-phpredis.html

 

posted @ 2017-01-14 16:06  nikolates_fei  阅读(1373)  评论(0编辑  收藏  举报