一、总结
一句话总结:下载扩展的dll,放入指定文件夹(php对应的扩展的目录php/ext),在配置文件php.ini中注册dll
尽量不要选择最新版php和redis扩展,下载时文件名的每一个字符尽量看懂意思
下载dll 放入php扩展插件文件夹 在配置文件php.ini中注册dll
1、查看教程是发现教程有错误的启示是什么,(3.解压缩后,将php_redis.dll和php_igbinary.dll拷贝至php的ext目录下)中的后一个文件教程里是错的?
多看几篇教程
发现出错,多多查看几篇教程
2、同样的方法,php5.6安装得起,php7.0.12没有安装起的原因?
错误是忽略版本 下载的东西细看文件名
忽略了版本,下载时文件名的每一个字符尽量看懂意思
二、Windows下为PHP安装redis扩展
1.使用phpinfo()函数查看PHP的版本信息,这会决定扩展文件版本。
2.下载php_igbinary-2.0.1-7.0-ts-vc14-x64.zip,php_redis-3.1.3rc2-7.0-ts-vc14-x64.zip(一定要保证版本的正确性)
下载地址:【选择适合的版本】
http://windows.php.net/downloads/pecl/snaps/redis/
http://windows.php.net/downloads/pecl/releases/igbinary/
redis : http://windows.php.net/downloads/pecl/releases/redis/
igbinary: http://windows.php.net/downloads/pecl/releases/igbinary/
ps:如果在PHP目录下看到php7ts.dll则选择ts版本
3.解压缩后,将php_redis.dll和php_igbinary.dll拷贝至php的ext目录下
4.修改php.ini,(PS:此php.ini文件是在Apache目录)在该文件中加入:
; php_redis
extension=php_igbinary.dll
extension=php_redis.dll
注意:extension=php_igbinary.dll一定要放在extension=php_redis.dll的前面,否则此扩展不会生效
5.重启Apache后,使用phpinfo查看扩展是否成功安装
6.打开redis服务后,可以用如下测试是否能够调用。
<"Connection to server sucessfully"; //设置 redis 字符串数据 $redis->set("tutorial-name", "Redis tutorial"); // 获取存储的数据并输出 echo "Stored string in redis:: " . $redis->get("tutorial-name"); "external nofollow" target="_blank" href="https://redis.io/download">https://redis.io/download】其实Redis是可以安装成windows服务的,开机自启动,命令如下:
redis-server --service-install redis.windows.conf
安装完之后,就可看到redis已经作为windows服务了:
但是安装好之后,Redis并没有启动,
启动命令如下:
redis-server --service-start
停止命令:
redis-server --service-stop
还可以安装多个实例
redis-server --service-install –service-name redisService1 –port 10001
redis-server --service-start –service-name redisService1
redis-server --service-install –service-name redisService2 –port 10002
redis-server --service-start –service-name redisService2
redis-server --service-install –service-name redisService3 –port 10003
redis-server --service-start –service-name redisService3卸载命令:
redis-server --service-uninstall
好了这篇文章就介绍到这了,需要的朋友可以参考一下。
PHP安装redis扩展
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。