https://blog.csdn.net/u010623954/article/details/80037078
https://www.cnblogs.com/rslai/p/8249812.html
执行make test 报错, 为缺少脚本
https://blog.csdn.net/luyee2010/article/details/18766911
redis使用密码连接
./redis-cli -h 127.0.0.1 -p 6379 -a Passw0rd
安装redis扩展
1、下载phpredis
cd /usr/local/
git clone https://github.com/xuanxiaox/phpredis.git
2、安装
cd phpredis #进入安装目录
/usr/local/php/bin/phpize #用phpize生成configure配置文件
./configure --with-php-config=/usr/local/php/bin/php-config #配置
make #编译
make install #安装
安装完成之后,出现下面的安装路径
/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
make test #测试
此时会提示需要配置php.ini文件
3、配置php支持
vim /usr/local/php/etc/php.ini #编辑配置文件,在最后一行添加以下内容
extension="redis.so"
4、 重启服务
sudo service nginx restart
sudo /etc/init.d/php-fpm restart
5、出现以下即安装成功
1、警告
WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128
打开
vim /etc/sysctl.conf
添加
net.core.somaxconn= 511
执行
sysctl -p
2、警告
WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect
打开
vim /etc/sysctl.conf
添加
vm.overcommit_memory = 1
执行
sysctl -p
网友评论