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

How to implement Redis connection and authentication in php

WBOY
WBOYforward
2023-05-28 15:07:11855browse

Redis connection and authentication

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

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete