标签:
------ redis安装,启动服务,开机启动,打开redis客户端 ------
yum install -y redis
systemctl start redis
systemctl enable redis
redis-cli
------ 安装phpredis ------
pecl install redis-2.2.3
extension_dir = "/usr/lib64/php/modules/"
extension=redis.so
------ 测试 ------
<?php
//Connecting to Redis server on localhost
$redis = new Redis();
$redis->connect(‘127.0.0.1‘, 6379);
echo "Connection to server sucessfully";
//check whether server is running or not
echo "Server is running: " . $redis->ping();
?>
标签:
原文地址:http://www.cnblogs.com/TsAihS/p/5836941.html