jdoe@home-pc:~# apt-get install redis-server
jdoe@home-pc:~# systemctl enable [email protected]
jdoe@home-pc:~# apt-get update
jdoe@home-pc:~# apt-cache pkgnames | grep php7.4
jdoe@home-pc:~# apt install php7.4-redis
jdoe@home-pc:~# service apache2 restart
jdoe@home-pc:~# redis-cli
https://redis.io/download#installation
https://tecadmin.net/install-redis-ubuntu
Download
https://github.com/tporadowski/redis/releases
Tutorial
https://www.c-sharpcorner.com/article/installing-redis-cache-on-windows
https://www.phpflow.com/php/how-to-setup-redis-server-and-use-with-php
- Download
php_redis.dll
file from PECL libs. Download extension as per your current PHP version. - Copy the
php_redis.dll
and paste to following folder in XAMPP Server extension directory(D:\XAMPP\php\ext
). - Open the
php.ini
file and addextension=php_redis.dll
line into this file. - Restart XAMPP server
- Open phpinfo() of XAMPP server and search Redis, if found that means you successfully integrated Redis with PHP.
<?php
try {
// create redis instance
$redis = new \Redis();
// connect with server and port
$redis->connect('localhost', 6379);
// set key
$redis->set('user', 'John Doe');
// get value
$user = $redis->get('user');
print($user); // John Doe
} catch (Exception $ex) {
echo $ex->getMessage();
}
I am trying to connect in Xampp but "No connection could be made because the target machine actively refused it." this error has shown me up.