试图让(p)redis运行?

时间:2017-09-16 15:26:31

标签: php redis

我试图让(p)redis运行但是只要我添加一个set->就无法连接到redis

require "predis/autoload.php";
Predis\Autoloader::register();
try {
  $redis = new Predis\Client();
  $redis->set("hello_world", "Hi from php!");
  $value = $redis->get("hello_world");
  var_dump($value);
  echo "Successfully connected to Redis";
}

但是

时它可以连接到Redis
require "predis/autoload.php";
Predis\Autoloader::register();
try {
  $redis = new Predis\Client();
  var_dump($redis);
  echo "Successfully connected to Redis";
}

任何提示?

0 个答案:

没有答案