1. <?php
    2. //连接本地的 Redis 服务
    3. $redis = new Redis();
    4. $redis->connect('10.1.3.15', 6379);
    5. $redis->auth('kuaicdn_redis_passwd');
    6. echo "Connection to server successfully";
    7. //查看服务是否运行
    8. echo "Server is running: " . $redis->ping();
    9. ?>