问题

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

转载于:https://www.cnblogs.com/canyuexiang/p/6240002.html

Laravel Predis Error while reading line from the server.相关推荐

  1. laravel ajax返回json,Laravel validate error处理,ajax,json示例

    如下所示: public function updateLevelTestRecords(Request $request) { $rules = [ 'uid' => 'required|in ...

  2. MySQL_解决ERROR 2006 (HY000) at line XX MySQL server has gone away问题

    MySQL_解决ERROR 2006 (HY000) at line XX MySQL server has gone away问题 参考文章: (1)MySQL_解决ERROR 2006 (HY00 ...

  3. ERROR: Unrecognized command line argument: #39;use#39;

    Unrecognized command line argument: 'use' gvm- -GoLang语言多版本管理工具 基础环境 centos6.5 报错内容 gvm在命令行以外的任何地方调用 ...

  4. 【mac】mac 安装 RibbitMQ 报错 Error when reading /Users/lcc/.erlang.cookie: eacces

    文章目录 1.概述 1.概述 在安装 [mac]Mac 安装 RabbitMQ 的时候遇到这个问题.Error when reading /Users/lcc/.erlang.cookie: eacc ...

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

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

  6. 已解决:An error occurred at line: 1 in the generated java file The type java.io.ObjectInputStream canno

    tomcat报错 An error occurred at line: 1 in the generated java file The type java.io.ObjectInputStream ...

  7. The server is invalid. Error occurred reading server credential. Required file or directory ‘serverO

    错误提示 改正 可以看到检测报错: The server is invalid. Error occurred reading server credential. Required file or ...

  8. suse12中pip install xxx报错gcc: error: unrecognized command line option ‘-fstack-clash-protection’

    我们在Linux中安装某些python的第三方包时,有时候需要gcc来进行协助编译安装(例如psutil.pycrypto等) 1.很不幸,最近在suse12中用pip install psutil时 ...

  9. 【问题解决方案】cc1plus: error: unrecognized command line option ‘-fdump-class-hierarchy’

    博主个人站点: http://azmddy.top 原文链接:[问题解决方案]cc1plus: error: unrecognized command line option '-fdump-clas ...

最新文章

  1. 基于WinSvr2012共享文件夹的Hyper-V实时迁移之三实时迁移的实现及验证
  2. Java中对象的销毁
  3. 【iOS报错】“this class is not key value coding-compliant for the key userPhoneNum”给字典设置键值对的时候报错...
  4. jittor和pytorch 生成网络对比之clustergan
  5. centos6.x安装mysql5.6及启动多实例
  6. Learning to Rank中Pointwise关于PRank算法源码实现
  7. window下安装Oracle11G安装
  8. Linux 7 cmake:curses library not found
  9. sqldeveloper的查看执行计划快捷键F10
  10. ssm框架图片上传与显示_SSM在线考试系统
  11. 基于linux在线预览
  12. 100个高质量Java开发者博客 【转】
  13. vue 小写金额转换为大写金额
  14. linux双核cpu调试软死锁问题,记一次linux通过jstack定位CPU使用过高问题或排查线上死锁问题...
  15. access to同义替换_access to 用法
  16. 小鸟云服务器FTP上传中断是什么原因?解决方法总结
  17. 树莓派+SSH反向代理实现远程开机
  18. 一些开源代码网站介绍(持续添加中....)
  19. consul 服务健康检查
  20. 【动网论坛7.1 sp1 修改】-会员信息修改方案

热门文章

  1. 单片机与微处理器和微型计算机的关系,微处理器、CPU、微处理机、微机、单片机它们之间有何区别?...
  2. php 魔术变量和超级全局变量,PHP超级全局变量与魔术变量
  3. linux c 监控文件内容改变,如何让程序监视C ++中的文件修改?
  4. 存clob为空的值_将网页文本(HTML)保存到ORACLE数据库CLOB字详解
  5. oracle无法登录em,oracle em登陆不了,账户密码过期
  6. python 解决最佳方案_python使用列表的最佳方案
  7. Python、Matplot的subplot实现一行3列的子图绘制,并添加背景色
  8. 网络模型:(0)背景
  9. 机器学习中使用的交叉熵(cross entropy)透彻分析
  10. FPGA(5)数码管静态显示与动态显示