Phpredis is a redis extension for PHP, and the PHP code can operate the Redis database only if Phpredis is installed. Only the methods for installing Phpredis are described below.
1. Download Phpredis, download directly from official git to local directory (~/soft/)
git clone https://github.com/jiangtong1125/phpredis.git (no git installed, can also be packaged and downloaded)
2. Enter the Phpredis directory
CD ~/soft/phpredis/
3. Execute phpize,/usr/local/php/bin/phpize (if there are multiple PHP versions locally, use the correct version)
4. Compile./configure--with-php-c/local/php/bin/php-config
5. Compile, directly perform make&&make install, install complete result
6. Go to the Red Flag directory and copy the redis.so file in the directory to the PHP extension directory.
How do I view the PHP extensions directory? Execute Phpinfo, Extension_dir is,
Copy to this directory
7. Add extension=redis.so to PHP.ini
8. Restart Apache and view Phpinfo again
Well done, happy to play!!!
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The above describes the Linux installation Phpredis, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.