Bacoхороша інструкція, давайте логи і заведемо редиску на бро)
При попытке загрузки страницы после изменения движка на redis выскакивает следующее:
Ошипка
Fatal error: Uncaught Error: Class 'Redis' not found in /system/library/cache/redis.php:10 Stack trace: #0 /system/library/cache.php(27): Cache\Redis->__construct(3600) #1 /xn--b1agjiih2ae7a5c.xn--90ais/system/framework.php(110): Cache->__construct('redis', 3600) #2/system/startup.php(104): require_once('/var/www/www-ro...') #3 /index.php(22): start('catalog') #4 {main} thrown in
/system/library/cache/redis.php on line
10В логах сервера:
Лог сервера
2021/12/24 18:48:45 [error] 1042#1042: *468260 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Class 'Redis' not found in /var/www/www-root/data/www/xn--b1agjiih2ae7a5c.xn--90ais/system/library/cache/redis.php:10
Stack trace:
#0 /system/library/cache.php(27): Cache\Redis->__construct(3600)
#1 /system/framework.php(110): Cache->__construct('redis', 3600)
#2 /system/startup.php(104): require_once('/var/www/www-ro...')
#3 /admin/index.php(21): start('admin')
#4 {main}
thrown in /system/library/cache/redis.php on line 10" while reading response header from upstream, client: 185.23.200.134, server: xn--b1agjiih2ae7a5c.xn--90ais, request: "POST /admin/ HTTP/1.1", upstream: "fastcgi://unix:/var/www/php-fpm/9.sock:", host: "xn--b1agjiih2ae7a5c.xn--90ais:443"
Дальше по инструкции само собой идти смысла нет
Содержимое redis.php
<?php
namespace Cache;
class Redis {
private $expire;
private $cache;
public function __construct($expire) {
$this->expire = $expire;
$this->cache = new \Redis();
$this->cache->pconnect(CACHE_HOSTNAME, CACHE_PORT);
}
public function get($key) {
$data = $this->cache->get(CACHE_PREFIX . $key);
return json_decode($data, true);
}
public function set($key,$value) {
$status = $this->cache->set(CACHE_PREFIX . $key, json_encode($value));
if($status){
$this->cache->setTimeout(CACHE_PREFIX . $key, $this->expire);
}
return $status;
}
public function delete($key) {
$this->cache->delete(CACHE_PREFIX . $key);
}
}