webman-push-server 出现错误,

软饭工程师

新创建的webman项目,引入webman-push-server,php start.php start 启动,出现错误 Call to undefined method Redis::xAutoClaim() ,composer update 也无效

php 版本8.1

❯ php --ri redis

redis

Redis Support => enabled
Redis Version => 5.3.7
Redis Sentinel Version => 0.1
Available serializers => php, json

composer.json

{
  "name": "workerman/webman",
  "type": "project",
  "keywords": [
    "high performance",
    "http service"
  ],
  "homepage": "https://www.workerman.net",
  "license": "MIT",
  "description": "High performance HTTP Service Framework.",
  "authors": [
    {
      "name": "walkor",
      "email": "walkor@workerman.net",
      "homepage": "https://www.workerman.net",
      "role": "Developer"
    }
  ],
  "support": {
    "email": "walkor@workerman.net",
    "issues": "https://github.com/walkor/webman/issues",
    "forum": "https://wenda.workerman.net/",
    "wiki": "https://workerman.net/doc/webman",
    "source": "https://github.com/walkor/webman"
  },
  "require": {
    "php": ">=7.2",
    "workerman/webman-framework": "^1.5.0",
    "monolog/monolog": "^2.0",
    "workbunny/webman-push-server": "^1.2"
  },
  "suggest": {
    "ext-event": "For better performance. "
  },
  "autoload": {
    "psr-4": {
      "": "./",
      "app\\": "./app",
      "App\\": "./app",
      "app\\View\\Components\\": "./app/view/components"
    },
    "files": [
      "./support/helpers.php"
    ]
  },
  "scripts": {
    "post-package-install": [
      "support\\Plugin::install"
    ],
    "post-package-update": [
      "support\\Plugin::install"
    ],
    "pre-package-uninstall": [
      "support\\Plugin::uninstall"
    ]
  }
}

redis官网 此函数在 6.2.0生效

截图
是phpredis 版本太低了吗

错误信息

#11 {main}
Error: Call to undefined method Redis::xAutoClaim() in /Users/xxx/www/test-webman/vendor/workbunny/webman-push-server/src/HookServer.php:170
Stack trace:

redis版本7.2

截图

509 1 0
1个回答

nitron

redis-server的版本是啥

  • 软饭工程师 2024-03-11

    7.2.0

  • nitron 2024-03-11

    你redis服务器是在本机么?不是的话连到redis服务器用info server看具体版本

  • 软饭工程师 2024-03-11
    ❯ redis-cli
    127.0.0.1:6379> info server
    # Server
    redis_version:7.2.0
  • fzhbs666 2024-03-12

    看看php扩展是否支持这个方法

  • 软饭工程师 2024-03-12

    vendor Redis.php 源码中没有xAutoClaim 这个方法,只有xClaim 这个方法

×
🔝