open-smf / connection-pool

A common connection pool based on Swoole is usually used as a database connection pool.
MIT License
222 stars 34 forks source link

Call to undefined method stdClass::close() #1

Closed fising closed 5 years ago

fising commented 5 years ago

[2019-05-27 22:06:12 *28.7] ERROR zm_deactivate_swoole (ERROR 503): Fatal error: Uncaught Error: Call to undefined method stdClass::close() in /app/vendor/open-smf/connection-pool/src/Connectors/PhpRedisConnector.php:32 Stack trace:

0 /app/vendor/open-smf/connection-pool/src/ConnectionPool.php(206): Smf\ConnectionPool\Connectors\PhpRedisConnector->disconnect(Object(stdClass))

1 {main}

thrown in /app/vendor/open-smf/connection-pool/src/Connectors/PhpRedisConnector.php on line 32.

hhxsv5 commented 5 years ago

应该是你的phpredis扩展版本低了,需要PhpRedis >= 4.2.0

fising commented 5 years ago

好的,我尝试升级看看。

fising commented 5 years ago

应该是你的phpredis扩展版本低了,需要PhpRedis >= 4.2.0

我看了一下,我的 Redis 扩展版本是 4.2.0:

redis Redis Support => enabled Redis Version => 4.2.0 Available serializers => php

Swoole 版本是 4.2.10

hhxsv5 commented 5 years ago

跟 Swoole 没关系,我用的 PhpRedis 4.3.0,你升级到这个版本试试。不过也很奇怪,4.2.0是有这个函数的,你没重启? 看看php --rc Redis|grep close root@14197b8b2f0d:/docker# php --rc Redis|grep close Method [ public method close ] {

fising commented 5 years ago

$php --rc Redis|grep close Method [ public method close ] {

fising commented 5 years ago

关键问题应该是Redis实例变成了stdClass吧?

hhxsv5 commented 5 years ago

return连接时是不是搞错对象了?

fising commented 5 years ago

return连接时是不是搞错对象了?

我也怀疑这个问题,还在检查。

hhxsv5 commented 5 years ago

v1.0.10