美文网首页
PHP连接Redis出现send of 26 bytes fai

PHP连接Redis出现send of 26 bytes fai

作者: Action_6ba3 | 来源:发表于2019-07-14 22:06 被阅读0次

先上一段代码:

$redis = new Redis();

$redis->connect('127.0.0.1', 6379); //连接Redis

$redis->set( "testKey" , "Hello Redis"); //设置测试key

echo $redis->get("testKey");//输出value

运行后报错:

Notice: Redis::get(): send of 26 bytes failed with errno=32 Broken pipe in /Users/xflyhack/Code/Redis/redis.php on line 6

解决方案:

(1)、登录redis服务端

     info clients  查看当前多少客户端连接;

获取当前redis允许最大连接数:config get maxclients

结果发现已经超过了最大连接数

解决方案:

config set maxclients 10000

相关文章

网友评论

      本文标题:PHP连接Redis出现send of 26 bytes fai

      本文链接:https://www.haomeiwen.com/subject/dscsbftx.html