'tcp', 'host' => $host, 'port' => $port, 'timeout' => 3.0, ]; if (!empty($password)) { $options['password'] = $password; } $redis = new Predis\Client($options); $pong = $redis->ping(); echo "Ping: $pong\n"; // Тест записи/чтения $testKey = 'test:predis:web:' . time(); $redis->setex($testKey, 10, 'hello from web'); $val = $redis->get($testKey); echo "Тест записи/чтения: $val\n"; $redis->del($testKey); echo "\n✅ SUCCESS: Redis через Predis работает из веб-сервера!\n"; } catch (Exception $e) { echo "❌ ERROR: " . $e->getMessage() . "\n"; }