Home > Database > Redis > How to implement Redis connection and authentication in php

How to implement Redis connection and authentication in php

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-05-28 15:07:11
forward
966 people have browsed it

Redis connection and authentication

//连接参数:ip、端口、连接超时时间,连接成功返回true,否则返回false
$ret = $redis->connect('127.0.0.1', 6379, 30);
//密码认证:成功返回true,否则返回false
$ret = $redis->auth('123456');
Copy after login

The above is the detailed content of How to implement Redis connection and authentication in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template