3X版本 在Application/MyApp/Redis/Reids.php 下 寫了個連接redis的代碼 如下
public function __construct($config = array()){
self::$redis = new \Redis();
self::$redis->pconnect($config,$config);
}
return self::$redis;
}
然后在MyApp/start.php里面使用
$config = array(
'host'=>'127.0.0.1',
'port'=>6379,
'timeout'=>1,
'database'=>0
);
$redis = new Redis\Redis($config);
報錯
PHP Fatal error: Uncaught exception 'RedisException' with message 'Redis server went away' in web/tom-workerman/Applications/MyApp/start.php:50 Stack trace:
請問這個是什么原因? 直接在start.php里面寫redis連接,并且操作是可以的