Mac MAMP Redis
2017-11-16 本文已影响21人
慢慢来111
- 下载redis
brew install homebrew/php/php56-redis
点击菜单 --> File --> Edit Template --> PHP --> PHP 5.6.10 php.ini
extension=/usr/local/Cellar/php56-redis/2.2.7_1/redis.so
$redis = new Redis();
$options = array();
$options['host'] = '127.0.0.1';
$options['port'] = '6379';
$redis->connect('', $options);
echo "Connection to server sucessfully";
//设置 redis 字符串数据
$redis->set("tutorial-name", "Redis tutorial");
// 获取存储的数据并输出
echo "Stored string in redis:: " . $redis->get("tutorial-name");die;