PhpredisUncaughtexception 'redisexception' withmessage' Redisserverwenta

Source: Internet
Author: User
PhpredisUncaughtexceptionRedisExceptionwithmessageRedisserverwenta php code:

Ini_set ('default _ socket_timeout ',-1 );
$ Redis = new Redis ();
$ Redis-> connect ("192.168.2.156", "6379"); // ip address and port set by the php client
$ Redis-> auth ('123 ');
// $ Redis-> select (1 );
$ Redis-> set ("say", "Hello World ");
$ Data = $ redis-> get ("say"); // output Hello World
Var_dump ($ data );
Error message: Fatal error: Uncaught exception 'redisexception' with message 'redis server went away 'in/usr/local/nginx/html/index. php: 56 Stack trace: #0/usr/local/nginx/html/index. php (56): Redis-> auth ('20140901') #1 {main} thrown in/usr/local/nginx/html/index. php on line 56
The redis service is turned on, and the firewall is closed. phpinfo also shows the redis extension of php. selinux is not useful no matter whether it is set to disabled or permissive. I really don't know what went wrong, expert advice


Reply to discussion (solution)

The problem has been solved, and people will post points!

The future of commerce depends on you.

The future of commerce depends on you.


That's right. I'm very satisfied with your answer !!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.