Predis 是 Redis 官方首推的 PHP 客户端开发包,要求 PHP 版本至少在 5.3 或者以上。
$redis = new Predis\Client(); $redis->set('library', 'predis'); $value = $redis->get('library'); $redis = new Predis\Client('tcp://10.0.0.1:6379'); // is equivalent to: $redis = new Predis\Client(array( 'scheme' => 'tcp', 'host' => '10.0.0.1', 'port' => 6379, ));