无法建立连接,因为目标机器主动拒绝它 LARAVEL 4 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16441774/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No connection could be made because the target machine actively refused it LARAVEL 4 error
提问by anuj rajput
No connection could be made because the target machine actively refused it. [tcp://127.0.0.1:6379] in laravel 4.My code is:
无法建立连接,因为目标机器主动拒绝它。[tcp://127.0.0.1:6379] 在laravel 4.我的代码是:
$redis = Redis::connection();
$redis->set('name', 'Taylor');
$name = $redis->get('name');
$values = $redis->lrange('names', 5, 10);
回答by ivahidmontazer
回答by yojimbo87
The problem could be that your redis instance either isn't running at all or is running on different host and/or port address (or port 6379 is closed by firewall).
问题可能是您的 redis 实例根本没有运行,或者正在不同的主机和/或端口地址上运行(或端口 6379 被防火墙关闭)。