php redis connection problem
给我你的怀抱
给我你的怀抱 2017-05-16 13:08:41
0
4
756

< 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.

给我你的怀抱
给我你的怀抱

reply all(4)
伊谢尔伦

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.

Ty80

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 version

刘奇

Your 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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template