We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

can't connect to redis

Hello!!! Help please ...

try {

$frontCache = new \Phalcon\Cache\Frontend\Data(array(
    "lifetime" => 172800
));

//Create the Cache setting redis connection options
$cache = new Phalcon\Cache\Backend\Redis($frontCache, array(
    'host' => 'localhost',
    'port' => 6379,
    'auth' => '',
    'persistent' => false
));

//Cache arbitrary data
$cache->save('my-data', '123');

//Get data
$data = $cache->get('my-data');
echo $data;

} catch (Exception $e) { die($e->getMessage()); }

But nothing ...

But terminal "redis-server" and "redis-cli" working well

please tell me any instructions on configuring redis with Falcon

But what's not working ? What exception you have, what error etc ?



14.4k

Fatal error: Class 'redis' not found in /var/www/



14.4k

Strangely enough, but the local version works as redis



145.0k
Accepted
answer

Install redis extension for php.



11.6k

and check your iptables or firewall..



14.4k

thanks friends. You really helped to understand.