配置php redis 扩展

Windows:

- 假设redis已经安装好 服务启动

- xampp (php 7.1 x86 windows)

查看phpinfo (php 7.1 x86/x64 ts/uts vc14/vc15)


Zend Extension Build API320160303,TS,VC14
PHP Extension Build API20160303, TS,VC14

https://windows.php.net/downloads/pecl/releases/igbinary/2.0.6rc1/
https://windows.php.net/downloads/pecl/releases/redis/3.1.3/

; php.ini
extension=php_igbinary.dll
extension=php_redis.dll

  

查看phpinfo 有redis扩展

test

<?php
//连接本地的 Redis 服务
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
echo "Connection to server sucessfully";
//设置 redis 字符串数据
$redis->set("tutorial-name", "Redis tutorial");
// 获取存储的数据并输出
echo "Stored string in redis:: " . $redis->get("tutorial-name");
?>

  

扫描二维码关注公众号,回复: 1864013 查看本文章

猜你喜欢

转载自www.cnblogs.com/mingzhanghui/p/9261940.html
今日推荐