brew tap redis-stack/redis-stack
brew install --cask redis-stack
redis-cli -h localhost -p 6379
localhost>
apt install pkg-php-tools
pecl install redis
<?php
$redis = new Redis();
//Connecting to Redis
$redis->connect('hostname', port);
$redis->auth('password');
if ($redis->ping()) {
echo "PONG";
}
?>
php connect.php
127.0.0.1:6379> monitor
OK
1614778301.165001 [0 [::1]:57666] "PING"