1.

How To Check Redis Is Running?

Answer»

To CHECK Redis is running try out the following code :

try
{
$redis = NEW Redis();
$redis->CONNECT('127.0.0.1', 6379);
echo "Redis is running.";
echo "SERVER is running: " . $redis->ping();
}
catch (Exception $e)
{
echo $e->getMessage();
}

To check Redis is running try out the following code :

try
{
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
echo "Redis is running.";
echo "Server is running: " . $redis->ping();
}
catch (Exception $e)
{
echo $e->getMessage();
}



Discussion

No Comment Found