In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor shares with you the method of installing redis and redis extensions in Linux. Many people don't know much about it. Today, in order to make you understand better, I summarized the following contents for you. Let's look down together. I'm sure you'll get something.
Redis, that is, remote dictionary service, is an open source log database written in ANSI C language, which supports network, memory-based and persistent Key-Value database, and provides API in multiple languages.
1. Download the source code, decompress 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 compilation is completed, there are four executable files redis-server, redis-benchmark, redis-cli and redis.conf in the Src directory. Then copy it to a directory. (redis.conf may also be on the upper 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 & running in the background
4. Then use the client to test whether the startup is successful.
$redis-cliredis > set foo barOKredis > get foo "bar"
Install the redis extension
Download: https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz
Add:
Download address of phpredis extension:
Https://github.com/phpredis/phpredis/archive/develop.zip
If the above one does not work, use the following address (the following address test environment is: php7.1 + redis 4.0.2)
Other steps are the same.
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 # extract cd phpredis-2.2.4 # enter the installation directory / usr/local/php/bin/phpize # generate configure configuration file with phpize. / configure-- with-php-config=/usr/local/php/bin/php-config # configuration make # compile make install # installation
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 # edits the configuration file, adding the following on the last line
Add
Extension= "redis.so"
: wq! # Save exit
3. Restart the service
Service php-fpm restart
The above is a brief introduction to the method of installing redis and redis extension in Linux. Of course, the differences in the detailed use of the above have to be understood by everyone. If you want to know more, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.