问题

Laravel说明文档中的 Redis 发布与订阅案例,命令行运行php artisan redis:subscribe 到60s自动断开并报错

 [Predis\Connection\ConnectionException]
Error while reading line from the server. [tcp://127.0.0.1:6379]

解决

config/database.php配置文件中,找到redis配置项,添加一行如下

'redis' => [

        'cluster' => false,

        'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
'read_write_timeout' => 0,//new
], ]

原因

据Predis作者在配置文件中说明,因为在底层网络资源上执行读取或写入操作时使用了超时,默认设置了timeout 为60s。

参考

https://github.com/nrk/predis/wiki/Connection-Parameters

Laravel Predis Error while reading line from the server.的更多相关文章

  1. laravel redis Error while reading line from the server.

    代码运行一段时间后,会报下面的错误. [Predis\Connection\ConnectionException] Error while reading line from the server. ...

  2. Faster RCNN 运行自己的数据,刚开始正常,后来就报错: Index exceeds matrix dimensions. Error in ori_demo (line 114) boxes_cell{i} = [boxes(:, (1+(i-1)*4):(i*4)), scores(:, i)];

    function script_faster_rcnn_demo() close all; clc; clear mex; clear is_valid_handle; % to clear init ...

  3. make module失败的原因cc1: error: unrecognized command line option “-m64

    cc1: error: unrecognized command line option "-m64"cc1: error: unrecognized command line o ...

  4. linux下安装QT5:error: unrecognized command line option ‘-fuse-ld=gold’

    安装qt时在执行./configure时报错:error: unrecognized command line option '-fuse-ld=gold' 这个错误是qt的一个bug. 在装有gol ...

  5. 编辑sass报错:error style.scss (Line 3: Invalid GBK character "\xE5")解决办法

    cmd.exe /D /C call C:/Ruby23-x64/bin/scss.bat --no-cache --update header.scss:header.css error heade ...

  6. 新部署tomcat,An error occurred at line: [1] index_jsp.java

    环境: centos6.5 32位 oracle jdk 1.8 tomcat 7 问题: yum install tomcat后,返回如下错误: [root@centos]~# curl -v ht ...

  7. cc1plus.exe: error: unrecognized command line option "-fno-keep-inline-dllexport "

    在Windows环境下的控制台上,通过qmake指令编译Qt程序时,出现 cc1plus.exe: error: unrecognized command line option "-fno ...

  8. Solve Error : Undefined function or variable ‘setInitialWorkingFolder’. Error in matlabrc (line 197)

    When compile program using Visual Studio 2015, Matlab 2016b, and OpenCV 3.1.0, one might get the err ...

  9. 编译openwrt时报错:fstools-2018-01-02-11efbf3b/libfstools/overlay.c: At top level: cc1: error: unrecognized command line option '-Wno-format-truncation' [-Werror]

    1. 详细错误信息 [ 11%] Building C object CMakeFiles/fstools.dir/libfstools/overlay.c.o/home/jello/openwrt/ ...

随机推荐

  1. 国内 Composer 镜像收集

    本文转载自: https://www.insp.top/article/composer-mirror-image 常见的: { "repositories": [ {" ...

  2. 康力优蓝机器人 -- 优友U05类人型机器人发布

    [寒武计划]优友U05类人型机器人发布: http://digi.tech.qq.com/a/20151124/043234.htm?pgv_ref=aio2015&ptlang=2052 北 ...

  3. yii2 [行为] behaviors 拦截器

    yii2 拦截器 在控制器中可以自定义对action的拦截器,拦截器需要继承 \yii\base\ActionFilter 参考代码: class BaseUserAuthorizeFilter ex ...

  4. Color Me Less

    Color Me Less Time Limit: 2 Seconds      Memory Limit: 65536 KB Problem A color reduction is a mappi ...

  5. Visual Studio工具——为编辑器增加垂直辅助线

    原文:<Visual Studio工具> Posted on 2014/03/13 ==================================================== ...

  6. c++中继承和java中继承的对比

    java中: class Parent{ public void test(int a){ System.out.println("Parent:" + a); System.ou ...

  7. 火狐浏览器修改userAgent

    火狐浏览器修改userAgent的办法: 在火狐浏览器地址栏输入“about:config”,按下回车进入设置菜单. 找到“general.useragent.override”,如果没有这一项,则点 ...

  8. 使用 CSS3 打造一组质感细腻丝滑的按钮

    CSS3 引入了众多供功能强大的新特性,让设计和开发人员能够轻松的创作出各种精美的界面效果.下面这些发出闪亮光泽的按钮,很漂亮吧?把鼠标悬停在按钮上,还有动感的光泽移动效果. 温馨提示:为保证最佳的效 ...

  9. 初遇sql server

    今天初始接触sql server 和mysql的语法有一些不同 sql server中使用[] 或双引号来表示数据库.字段名.表名等,而字符串使用单引号来表示 mysql中数据库名,表名,字段名不需要 ...

  10. 基于HTML5技术的电力3D监控应用(三)

    继(一)和(二)之后不少,不少网友问我移动终端的使用问题,因为我们项目这次采用Android平板终端,所以我对这方面有点肤浅的研究,这篇分享些项目经验总结,希望对大家有所帮助. 电力3D项目去年底刚立 ...