当前位置:网站首页>win系统下安装redis以及windows扩展方法
win系统下安装redis以及windows扩展方法
2022-07-07 01:13:00 【菜鸟一号mmmm】
一、查看 php 版本相关信息
通过 phpinfo() 函数查看 php 版本相关信息,此操作是用来决定选择 redis 哪个扩展版本。
phpinfo();
找到如下2个参数:
参数:Architecture 值:x86
参数:PHP Extension Build 值:API20170718,NTS,VC15
如图所示:
二、下载 php 的 redis 扩展
进入 PHP 官方扩展页面,下载合适的 redis 扩展
1、PHP 官方扩展地址:http://pecl.php.net/
2、在页面右上角 Search for 搜索框中输入 redis 回车搜索
3、在搜索结果列表 Search results 中
对应的地址如下:http://pecl.php.net/package-search.php?pkg_name=redis
点击 redis 进入扩展详细页
4、会看到如下字样的版本号,即:alpha, beta, stable
stable 稳定版本,最终发行版本
beta 公开测试版本,alpha 版本的升级版
alpha 内部测试版本
对应的地址如下:http://pecl.php.net/package/redis
这里我们选择最新版的稳定版本,即:5.3.2 stable 2020-10-22 发布的,点击 DLL 进入下载页
5、根据第一步中提供的参数,这里我们选择 (NTS) x86 版本的扩展
对应的地址如下:http://pecl.php.net/package/redis/5.3.2/windows
如,点击:7.2 Non Thread Safe (NTS) x86 即可下载
6、在下载下来的压缩包中,会发现有一个文件:php_redis.dll
把此文件复制到 PHP 的 ext 目录下
三、修改 php.ini 配置文件,并重启服务器
1、修改 php.ini 文件,把 php_redis.dll 文件加入到 php 的配置中,如下:
extension=php_redis.dll
2、重启服务器,使新添加的 redis 扩展生效
3、再次回到 phpinfo() 页面查看,会发现 php 的 redis 扩展已经安装上了
网络很多案例到这一步就结束了,但是发现程序无法运行,接着往下看
四、安装 redis 服务端
1、下载地址如下:
Releases · microsoftarchive/redis · GitHub
这里我们下载 Redis-x64-xxx.zip压缩包到 D 盘redis文件夹下。
2、下载下来后,比如存放到:D:\ruanjian\Redis-x64-3.0.504/目录下,解开压缩包,目录如下:
3、双击 redis-server.exe 则服务端 redis 就运行了,效果如下:需要注意的是,此窗口不能关闭,一旦关闭就会导致程序不能运行。
4、此时再次运行 php 代码,发现已经成功执行了。
五、设置 Windows 下 redis 开机自启动
1、快捷键Window徽标键+R键,打开“运行”程序。
2、运行,打开:输入compmgmt.msc敲回车。
3,服务和应用程序 - 服务
4,Redis状态显示为启动,
希望此文档可以对大家有用!!!
边栏推荐
- 每秒10W次分词搜索,产品经理又提了一个需求!!!(收藏)
- Flask1.1.4 Werkzeug1.0.1 源碼分析:啟動流程
- MySQL performance_ Schema common performance diagnosis query
- 980. 不同路径 III DFS
- Cf:c. column swapping [sort + simulate]
- On the difference between FPGA and ASIC
- [daily training -- Tencent selected 50] 292 Nim games
- 老板总问我进展,是不信任我吗?(你觉得呢)
- [FPGA tutorial case 13] design and implementation of CIC filter based on vivado core
- Senior programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization, and recommends collecting
猜你喜欢
Industrial Finance 3.0: financial technology of "dredging blood vessels"
可极大提升编程思想与能力的书有哪些?
The boss always asks me about my progress. Don't you trust me? (what do you think)
【SQL实战】一条SQL统计全国各地疫情分布情况
Introduction to the extension implementation of SAP Spartacus checkout process
Say sqlyog deceived me!
[云原生]微服务架构是什么?
Loss function and positive and negative sample allocation in target detection: retinanet and focal loss
693. 行程排序
JVM监控及诊断工具-命令行篇
随机推荐
Add salt and pepper noise or Gaussian noise to the picture
ML's shap: Based on the adult census income binary prediction data set (whether the predicted annual income exceeds 50K), use the shap decision diagram combined with the lightgbm model to realize the
360织语发布7.0新品 为党政军、央国企打造专属“统一数字工作空间”
苹果cms V10模板/MXone Pro自适应影视电影网站模板
Personal imitation SSM framework
Swagger3 configuration
成为资深IC设计工程师的十个阶段,现在的你在哪个阶段 ?
Convert numbers to string strings (to_string()) convert strings to int sharp tools stoi();
软件测试知识储备:关于「登录安全」的基础知识,你了解多少?
Bypass open_ basedir
10W word segmentation searches per second, the product manager raised another demand!!! (Collection)
Ten stages of becoming a Senior IC Design Engineer. What stage are you in now?
JVM命令之- jmap:导出内存映像文件&内存使用情况
[daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree
Data storage 3
mac版php装xdebug环境(m1版)
Nvisual network visualization
Jmeter自带函数不够用?不如自己动手开发一个
Dc-7 target
Interview questions and salary and welfare of Shanghai byte