brew install homebrew/php/php56-redis
點(diǎn)擊菜單 --> 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";
//設(shè)置 redis 字符串?dāng)?shù)據(jù)
$redis->set("tutorial-name", "Redis tutorial");
// 獲取存儲(chǔ)的數(shù)據(jù)并輸出
echo "Stored string in redis:: " . $redis->get("tutorial-name");die;
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者