Phpredis installation and use redis is a key-value storage system phpredis is an extension of php, which is highly efficient. redis installation with the linked list sorting function: & nbsp; 1. download source code & nbsp; & n php redis installation and use
Redis is a key-value storage system.
Phpredis is an extension of php with high efficiency. it has the linked list sorting function.
Redis installation:
1. download source code
Official website: http://redis.io/download
Addresses: http://redis.googlecode.com/files/redis-2.4.17.tar.gz
2. Compile and install
Tar-zxvf redis-2.4.14.tar.gz
Cd redis-2.4.14
Make
3. start the service
Redis-server redis. conf (modifiable configuration: redis. conf)
4. test
Redis-cli
Redis 127.0.0.1: 6379> (indicating that the client is successfully enabled)
Environment required:
Gcc (yum install gcc-c ++)
Tcl-8.5.12 (see: http://www.linuxfromscratch.org/blfs/view/cvs/general/tcl.html)
Php redis module installation:
1. download source code
Website: https://github.com/owlient/phpredis
Wget https://nodeload.github.com/owlient/phpredis/tarball/master> owlient-phpredis-2.1.1-1-g90ecd17.tar.gz
2. Compile and install
Tar-zxvf owlient-phpredis-2.1.1-1-g90ecd17.tar.gz
Cp owlient-phpredis-90ecd17/usr/include/php/ext/(copy the file to the ext Directory of the php source directory)
/Usr/bin/phpize (run phpize. if you do not know where it is, run the whereis phpize command)
Cd/usr/include/php/ext/owlient-phpredis-90ecd17/
./Configure-with-php-config =/usr/bin/php-config (note your php-config path)
Make & make install
3. modify the php configuration and load the redis. so module.
Vi/etc/php. d/redis. ini: extension = redis. so
4. test
Phpinfo (8) (View module loading information)
connect('127.0.0.1'); $redis->select(1); $ret = $redis->set('testzzj', 'test'); var_dump($ret); $allKeys = $redis->keys('*'); print_r($allKeys);