Home  >  Article  >  Backend Development  >  How to install redis extension for php

How to install redis extension for php

WJ
WJOriginal
2020-06-01 11:06:303493browse

How to install redis extension for php

phpHow to install the redis extension of php:

1. Install redis

Please go to https for the Redis installation process ://www.cnblogs.com/IT-Crowd/articles/10626765.html

2. Download Redis extension

 [root@root php-extension]# wget https://pecl.php.net/get/redis-4.3.0.tgz

3. Unzip tar -zxvf redis-4.3.0.tgz

[root@root php-extension]# tar -zxvf redis-4.3.0.tgz

4. Generate configure configuration file

 [root@root php-extension]# cd redis-4.3.0
 [root@root redis-4.3.0]# /usr/local/php/bin/phpize

5.Install redis extension

  [root@root redis-4.3.0]# ./configure --with-php-config=/usr/local/php/bin/php-config
 [root@root redis-4.3.0]# make && make install

Installation completion prompt:

Build complete.
Don't forget to run 'make test'.

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

6. Add Redis extension in php.ini

First configure extension_dir:

extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/"

Add extension = redis.so under extension_dir

7. Restart PHP

 [root@root redis-4.3.0]# service php-fpm restart

8.Redis extension installed successfully

How to install redis extension for phpRelated reference:php中文网

The above is the detailed content of How to install redis extension for php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn