Install the php redis extension in ubuntu
Execute php-m first. If you don't see redis, you need to install the php redis extension.
To download the source code, we assume that there is a git folder in the home directory to manage git files
$cd ~ / git/$ git clone https://github.com/phpredis/phpredis.git
Move the downloaded source code to the / etc file, and then enter this directory
$mv phpredis/ / etc/$ cd / etc/phpredis
Execute phpize to generate compilation files, where you may need to install php7.2-dev
Ubuntu does not have phpize installed, execute the command: sudo apt-get install php7.2-dev to install phpize
Phpize// install php7.0-dev$ sudo apt install php7.0-dev according to the prompts
Compilation and installation
$sudo. / configure$ make & & make install
In this way, the redis.so file has been generated in the usr\ lib\ php\ 20170718 directory, and the directory usr\ lib\ php\ 20170718 is the extension_dir in php.ini.
Add redis.ini to the etc\ php\ 7.2\ mods-available directory and add the following content extension=redis.so
Add link file
Sudo ln-s / etc/php/7.2/mods-available/redis.ini / etc/php/7.2/cli/conf.d/20-redis.ini restart nginx/etc/init.d/nginx restart