Blogger Information
Blog 38
fans 0
comment 3
visits 43852
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
aedis安装和使用和扩展
意外的博客
Original
942 people have browsed it
  1. 注意,安装redis时,防火墙一定要关闭;

  2. redis下载地址:    https://pan.baidu.com/s/1wxgWVtswnRHfTc1ldVlHrw    ;是一个5M的文件;

  3. 将下好的文件解压到准备好的文件夹中(一般随便在哪里建文件夹都可以),双击''redis-server.exe''看是否能打开?    no->4;yes->5

  4. 打开cmd命令提示符,进入到存入的盘中,然后输入'cd 这个文件所在的目录',回车,

  5. 然后输入命令"redis-server.exe redis.windows.conf ",回车;

  6. 就会进入监听;

  7. 在当前文件夹中双击''redis-cli.exe'',会显示''127.0.0.1:6379'',

  8. 然后输入hset 表名 键 值,回车,显示(integer) 1,

  9. Redis-x64-3.0.504.msi,下载安装这个服务,就是可以不用一直打开监听,可有可无;

  10. php redis 扩展下载 ;http://pecl.php.net/package/redis 根据PHP版本,是否为线呈,x86/x64选择版本;

  11. 将下好的文件中php_redis.dll放到php-7.2.1-nts\ext目录中,然后返回上一页到php-7.2.1-nts中;

  12. 接着找到php.ini,点击进去在extension=php_末端添加extension=php_redis.dll即可;

  13. 重启工具箱;

  14. WebSocket服务开启: 在cmd中进入到指定的盘->chat.php的目录中(E:\phpworkbox_1\myphp_www\PHPTutorial\WWW\IMdemo\chat_server);然后输入php chat.php start即可;

<?php

$redis = new Redis();
$redis->connect('127.0.0.1',6379);
// $redis->set('qq','admins');
//向redis中存值;
 $redis-> hSet('mytable','name','xiaolu');

$res = $redis->hGet('mytable','name');
print_r($res);    //输出为xiaohu

// 在redis-cli.exe里面操作下面代码;
// 127.0.0.1:6379> hget mytable name
// "xiaolu"


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post