1. First Create a folder in /usr/local/ reids
cd/usr/local/
mkdir Redis
2. Place the Redis installation package under the redis directory for decompression phpredis-2.2.4.tar.gz;
Tar ZVXF phpredis-2.2.4.tar.gz
Tar ZVXF redis-3.2.0.tar.gz
3. Go to Redis unzipped installation package redis-3.2.0.tar.gz make compile
cd/usr/local/redis/redis-3.2.0
Make
4. Find a place to create a redis file ( I put it in the root directory )
CD/
mkdir Redis
5. Enter the Redis installation package CP redis profile redis.conf
cd/usr/local/redis/redis-3.2.0
Cp Redis.conf/redis
6. Enter the src copy of the redis installation package to the client and server-side redis-server (server) redis-cli (client)
cd/usr/local/redis/redis-3.2.0/src/
Cp redis-cli Redis-server/redis
7. Go to the root directory redis boot redis
Cd/redis
./redis-server redis.conf (for startup success)
8. Start the process
./redis-cli
9. (It does not open successfully) to modify the configuration . conf daemonize no to Yes and restart Redis
./redis-server
./redis-cli
( successful installation )
Turn on Redis extensions
Upload phpredis-2.2.4.tar.gz to /usr/local/src directory
CD/USR/LOCAL/SRC # Enter the package storage directory
Tar zxvf phpredis-2.2.4.tar.gz # Unzip
CD phpredis-2.2.4 # Enter the installation directory
/phpstudy/server/php/bin/phpize # Generating Configure configuration files with phpize (This is where the phpize package of the Phpstudy integrated environment is placed where the phpize files are stored according to their different environments ( find-name phpize the next address remains the same )
./configure--with-php-config=/usr/local/php/bin/php-config # Configuration
Make # compilation
Make install # installation
After the installation is complete, the following installation path appears to indicate success
/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
2. Configure PHP support
Vi/usr/local/php/etc/php.ini # Edit the configuration file and add the following on the last line
Add to
extension= "Redis.so"
: wq! # Save Exit
Restart Service after completion
See Phpinfo there 's a redis extension.
Test:
1, vi/usr/share/html/index.php phpinfo ();
2, vi/usr/share/html/index.php
<?php
$redis =new Redis ();
$redis->connect ("127.0.0.1", "6379");
$redis->set ("name", "Shaofeifei");
$redis->get ("name");
Echo $redis;
?>
Installation and extended configuration under Redis Linux