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

How to implement Redis connection and authentication in php

WBOY
Release: 2023-05-28 15:07:11
forward
858 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:
source:yisu.com
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