Note: Permissions for the directory CHOMD 777-r
1. Installing Redis
Download: https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
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=/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/redis.so
: wq! #保存退出
3. Restart fpm-fastcgi Service SUDU/ETC/INIT.D/PHP-FPM restart
Install the Redis service
Installation
Download, extract and compile Redis with:
$ wget http://download.redis.io/releases/redis-3.0.0.tar.gz$ tar xzf redis-3.0.0.tar.gz$ cd redis-3.0.0$ make
The binaries that is now compiled is available in the src
directory. Run Redis with:
$ src/redis-server
You can interact with Redis using the built-in client:
$ src/redis-cliredis> set foo barOKredis> get foo"bar"
Installing the Redis extension in a Linux environment