无法建立连接,因为目标机器主动拒绝它 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 07:45:41  来源:igfitidea点击:

No connection could be made because the target machine actively refused it LARAVEL 4 error

phpredislaravel

提问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

After Installing redis server(you can download it form redis) you should simply run file redis-server.exeoften located in C:\Program Files\Redis\and refresh your page!

安装 redis 服务器后(您可以从redis下载),您应该简单地运行redis-server.exe通常位于其中的文件C:\Program Files\Redis\并刷新您的页面!

回答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 被防火墙关闭)。