1. You need to download a php redis extension source code for the required resources. You can download it here in advance. Github.comnicolasffphpredisarchivemaster.zip 2. installation 1. Unzip the package 123 first? Unzipphpredis
1. You need to download a php redis extension source code for the required resources. You can download it here in advance. Https://github.com/nicolasff/phpredis/archive/master.zip 2, installation 1, first extract 1 2 3? Unzip phpredis-master. zip? 2. Installation Note: first find the php installation directory, for example, in/usr/local/php
I. required resources
You need to download a php redis extension source code. You can download it here in advance. Https://github.com/nicolasff/phpredis/archive/master.zip
Ii. installation 1. Unzip the package first
1 2 3 |
? Unzip phpredis-master.zip ? |
2. Installation
Note: first find the php installation directory. The example is in/usr/local/php
.
1 2 3 4 5 6 7 |
? Cd phpredis-master /Usr/local/php/bin/phpize ./Configure-with-php-config =/usr/local/php/bin/php-config Make Make install ? |
3. Modify php. ini
Find php. ini and addextension=redis.so
Restart apache, nginx, or php-fpm
Iii. Test
Relatively simple test
1 2 3 4 5 6 |
? $ Redis = newRedis (); $ Redis-> connect ('2017. 0.0.1 ', 127 ); $ Redis-> set ('test', 'Hello world! '); Echo $ redis-> get ('test '); ? |
Original article address: Do not recompile php to install the redis extension. Thank you for sharing it with me.