我们使用phpredis,这个扩展能让你用PHP操作redis。

源码下载:

phpize ./configure make && make install

在php.ini 文件中,添加配置:

[redis]
extension=redis.so

查找extension dir方法:在phpinfo信息中搜extension_dir,我的位于/usr/lib64/php/modules

service php-fpm restart 

通过phpinfo可以看到为2.2.5版

<?php
$redis=new redis();
$result=$redis->connect('127.0.0.1',6379);
var_dump($result);
echo $redis->get('mykey');

艺搜参考

http://redis.io/clients

https://github.com/nicolasff/phpredis

redis php 实例一

http://blog.csdn.net/love__coder/article/details/8691679

相关文章:

  • 2021-06-28
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
  • 2021-11-07
  • 2022-01-24
  • 2021-12-22
猜你喜欢
  • 2022-12-23
  • 2021-09-07
  • 2022-03-03
  • 2021-08-04
  • 2021-08-16
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案