Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and configuration of redis extension in mac

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor will bring you an article about the installation and configuration of redis extensions in mac. The editor thinks it is very practical, so I will share it for you as a reference. Let's follow the editor and have a look.

Redis is a high-performance key-value database. The emergence of redis makes up for the deficiency of key/value storage such as memcached to a great extent, and can play a good complementary role to relational database in some cases. Written in ANSI C language, supports network, memory-based and persistent log, and provides API in multiple languages.

Mac itself has its own php environment, but the redis extension is not installed, so we need to install it separately. I'll talk about the installation steps below and what you need to pay attention to.

Install and start redis

1. Extract the downloaded redis to the / usr/local directory and run the command: tar-zxvf redis-5.0.5.tar.gz-C / usr/local/redis-5.0.5

2. The terminal enters the decompressed root directory: cd / usr/local/redis-5.0.5

3. Test and compile: sudo make test

4. Install redis:sudo make install

If you test the Times in step 4 as follows:

Executing test client: couldn't execute "src/redis-benchmark": no such file or directory.

Then perform the following two steps

(1), sudo make distclean

(2), sudo make

5. Configuration

After the above installation is successful, configure the php.ini file:

Extension_dir = "/ usr/lib/php/extensions/no-debug-non-zts-20131226/"

# the address here is the location where your reids installed redis.so.

Extension = redis.so

6. Printout phpinfo () to see if the installation is successful. If you can see the following information, the installation is successful.

(check whether redis is installed successfully: you can also execute make test after the installation is complete. [o / All tests passed without errors!] [Cleanup: may take some time...] appears OK] indicates that redis was installed successfully. )

7. Change [daemonize no] to [daemonize yes] in redis.conf of redis root directory to start in background operation mode.

8. Start redis to execute the command in the redis root directory:. / src/redis-server. / redis.conf, stop the redis service can execute the client command:. / src/redis-cli shutdown

9. The login client command is [. / src/redis-cli] or [. / src/redis-cli-p 6379] or [telnet 127.0.0.1 6379], executed in the root directory of the redis installation folder.

Test redis

After completing the installation and launching redis, the login client can test the redis.

Example:

127.0.0.1 OK127.0.0.1:6379 6379 > set key "success" / / write data OK127.0.0.1:6379 > get key / / read data "success" 127.0.0.1 OK127.0.0.1:6379 6379 > question summary

1. Prompt when sudo make install

Installing shared extensions: / usr/lib/php/extensions/no-debug-non-zts-20131226/

Cp: / usr/lib/php/extensions/no-debug-non-zts-20131226/#INST@12567#: Operation not permitted

Make: * [install-modules] Error 1

Solution: mac php installs extended make install not permit

2. After installation, configure the php.ini file

Extension=redis.so was added to the file, and when testing redis, it was found that it did not come out.

Solution:

Extension_dir = "/ usr/local/php/lib/php/extensions/no-debug-zts-20090626" # the address returned by make install in the address

Extension=redis.so

The above is the installation and configuration of the redis extension in mac, and you need to use it yourself in order to understand the details. If you want to know more about it, 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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report