PHP uses phpredis to link redis error

WBOY
Release: 2023-03-01 17:08:01
Original
3935 people have browsed it

As mentioned, the project uses phpredislink redis, and occasionally the following error is reported:

<code>PHP Fatal error:  Uncaught exception 'RedisException' with message 'Failed to AUTH connection' in [no active file]:0
Stack trace:
#0 {main}

  thrown in [no active file] on line 0```</code>
Copy after login
Copy after login
  1. checkThe configuration information of the project is correct, this error message appears occasionally

  2. Use redis to process session

  3. in the project
  4. Found someone in the issues of github who encountered a similar problem, but the reason and how to solve it were not given. Portal github

Have you encountered similar problems in your projects? Should you use the predis extension directly?

Reply content:

As mentioned, the project uses phpredislink redis, and occasionally the following error is reported:

<code>PHP Fatal error:  Uncaught exception 'RedisException' with message 'Failed to AUTH connection' in [no active file]:0
Stack trace:
#0 {main}

  thrown in [no active file] on line 0```</code>
Copy after login
Copy after login
  1. checkThe configuration information of the project is correct, this error message appears occasionally

  2. Use redis to process session

  3. in the project
  4. Found someone in the issues of github who encountered a similar problem, but the reason and how to solve it were not given. Portal github

Have you encountered similar problems in your projects? Should you use the predis extension directly?

Purely complaining, the phpredis extension is getting more and more painful. . . .

See if the error is an authorization-related error. Check whether Redis has a password. If it is a cluster deployment, whether the environment is inconsistent

<code>$client = new Predis\Client(array(
    'scheme'   => 'tcp',
    'host'     => '127.0.0.1',
    'port'     => 6379,
    'database' => 15,
    'password' => '密码'
));</code>
Copy after login

Did the authentication prompt fail?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!