指令行直接連:
redis-cli -h host -a 6379:password
php擴充:
$redis = new Redis();
$redis->connect(host,6379);
$res = $redis->auth(password);
<?php
//Connecting to Redis server on localhost
$redis = new Redis();
$redis->connect('host', 6379);
echo "Connection to server sucessfully";
//check whether server is running or not echo "Server is running: "+ $redis->ping();
?>
本文轉自wsw26 51CTO部落格,原文連結:http://blog.51cto.com/wsw26/2066341,如需轉載請自行聯系原作者