Installing Redis
1, download the source code, unzip and compile the source code.
wget http://download.redis.io/releases/redis-4.0.2.tar.gztar xzf redis-4.0.2.tar.gzcd xzf redis-4.0.2make
2, after the completion of the compilation, in the SRC directory, there are four executable files Redis-server, Redis-benchmark, Redis-cli and redis.conf. And then copy it to a directory. (redis.conf may also be on the previous floor)
MKDIR/USR/REDISCP redis-server /usr/rediscp redis-benchmark/usr/rediscp redis-cli /usr/rediscp redis.conf /usr/rediscd/usr/redis
3. Start Redis service.
./redis-server // ./redis-server & Background Run
4, then use the client to test whether to start successfully.
$ redis-cliredis> set foo barokredis> get foo "bar"
Installing the Redis Extension
Download: https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
Add:
Phpredis Extensions:
Https://github.com/phpredis/phpredis/archive/develop.zip
If the above does not work then use the following address (the following address test environment: php7.1 + Redis 4.0.2)
The other steps are the same
Upload phpredis-2.2.4.tar.gz to/usr/local/src directory
CD/USR/LOCAL/SRC #进入软件包存放目录
Tar zxvf phpredis-2.2.4.tar.gz #解压
CD phpredis-2.2.4 #进入安装目录
/usr/local/php/bin/phpize #用phpize生成configure配置文件
./configure--with-php-config=/usr/local/php/bin/php-config #配置
Make #编译
Make install #安装
After the installation is complete, the following installation path appears
/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
2. Configure PHP Support
Vi/usr/local/php/etc/php.ini #编辑配置文件, add the following on the last line
Add to
extension= "Redis.so"
: wq! #保存退出
3 Restart Service
Service PHP-FPM Restart
The experience of Ann turn
The above is to see an article on the CSDN, but my Linux environment is still not working, after I changed the above to another path to the Redis extension, or not, after repeated reasons, and finally found in the php.ini redis configuration path is not correct, changed to good.
Attached to find the reason to see the article, I hope to give you some help.
http://blog.csdn.net/phperguan/article/details/77969058
Installing Redis and extensions in Linux environments