white-poto/redis-sentinel

大佬您好 我composer 的时候遇到了问题

Closed this issue · 2 comments

[root@VM_0_12_centos redis-sentinel]# composer install
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested PHP extension ext-redis >=2.2.8 is missing from your system. Install or enable PHP's redis extension.

[root@VM_0_12_centos redis-sentinel]#
提示我没有找到redis 的扩展 但是我安装了 redis 扩展

Redis Support enabled
Redis Version 3.1.3
Available serializers php
这个怎么解决呀

还有就是 如果我把 composer.json 的

"require": {
"php": ">=5.3.0",
"ext-redis": ">=2.2.8"
},
判断redis 扩展的这段代码删除掉 能完成composer install 但是我运行 examples 目录中的例子时 提示我没有Jenner\RedisSentinel\Sentinel 类
Fatal error: Uncaught Error: Class 'Jenner\RedisSentinel\Sentinel' not found in /usr/local/nginx/html/redis-sentinel.php:16
Stack trace:
#0 {main}
thrown in /usr/local/nginx/html/redis-sentinel.php on line 16

因为这个项目依赖的php扩展是有版本限制的,低版本的没有提供相关API,看提示是你的phpredis扩展版本过低,升级下就好了