windows 上安装redis和windows上redis与php扩展
1.下载redis压缩包(自己选择想要的版本,1,2地址任意选一个)
下载window版本地址1:https://github.com/dmajkic/redis/downloads
下载window版本地址2:https://github.com/lennyhuanga/redis-windows/tree/master/downloads
php 扩展下载直接使用对应的版本(php版本有nts和ts版本 :怎么看,通过echo PHPinfo()
查看配置信息里面Zend Extension Build或者HP Extension Build对应值里面是否有ts或者nts自己选择)
http://windows.php.net/downloads/pecl/releases/igbinary/
http://windows.php.net/downloads/pecl/snaps/redis/
下载zip解压到指定目录通过
dos命令:cd /d e:/你们的redis解压的目录/
针对redist2.5以上版本dos命令
将redis默认实例加入windows服务:
redis-server.exe --service-install redis.windows.conf --loglevel verbose
默认实例服务启动:redis-server --service-start
默认实例服务关闭:redis-server --service-stop
默认实例卸载:redis-server --service-uninstall
安装多个实例
redis.windows1.conf文件是拷贝redis目录里面的redis.windows.conf文件改的名称
实例为redis1 (可以自己取名称):
prot 端口10001(自己给)
安装redis1 实例服务:redis-server --service-install redis.windows1.conf --service-name redis1 --port 10001
redis1 实例服务启动:redis-server --service-start --service-name redis1 redis.windows1.conf
redis1 实例服务停止:redis-server --service-stop --service-name redis1 redis.windows1.conf
redis1 服务卸载:redis-server --service-uninstall --service-name redis1 redis.windows1.conf
windows自带的处理命令
sc delete 服务名称来卸载服务
net start ServiceName(服务名称)
net stop ServiceName(服务名称)
php扩展安装
php_igbinary.dll
php_redis.dll
这两个文件放入你对应的PHP版本目录下的ext目录下:
在php.ini配置文件里面配置
extension=php_igbinary.dll
extension=php_redis.dll
输出php配置看一下有没有redis,有成功。
简单列子测试:必须先启动redis服务
$redis=new Redis(); $redis->connect('127.0.0.1',6379); $redis->auth('123456'); $redis->set('test','helloworld'); echo $redis->get('test');
最新文章
- eclipse gradle插件(buildship)的安装和使用
- java.sql.SQLException: [Microsoft][ODBC 驱动程序管理器] 在指定的 DSN 中,驱动程序和应用程序之间的体系结构不匹配
- 转载:JavaSE之反射
- AngularJs定制样式插入到ueditor中的问题总结
- Robots.txt 协议详解及使用说明
- js事件小记
- Stimulsoft Reports报表工具
- 14.8.3 Physical Row Structure of InnoDB Tables InnoDB 表的物理行结构
- Qt之Windows开发移植问题汇总
- SpringMVC框架(一)
- 2.1synchronized同步方法
- Spring Cloud是怎么运行的?
- jQuery与JS中的map()方法使用
- react-router简介
- Maven中使用本地JAR包
- CPU温度问题
- IC 设计中DFT的Boundary Scan功能
- Django中连接redis
- VS Supercharger插件的破解
- Python3 OpenCV应用