< br>Why when I print the phpinfo() function, it shows that there is a redis extension (as shown above), but when I call the extension_loaded('Redis') method, it returns false. As a result, new Redis() cannot be used to connect to redis. But I can use Predis to connect to redis. What is the reason? What is the difference between Redis and Predis connections? If you use these two connection methods respectively, what needs to be installed respectively? Please give me some advice.
This is equivalent to installing the redis client, and you have to install the redis server on the server side!
This means that your PHP has already installed the redis extension, and you also need to install redis.
Use
class_exists('Redis')
instead to determine whether the extension is loaded successfully. The problem you encounter may be a bug. The redis extension you installed is still the RC versionYour screenshot shows that the redis extension has been installed, namely phpredishttps://github.com/phpredis/p...
phpredis
是用C写的php扩展,需要编译安装。predis
是用php写的php扩展,直接使用,laravel 默认的就是predis
You said the connection cannot be made, you can post the error to see