How to install redis extension for php

WJ
Release: 2023-03-01 09:58:02
Original
3363 people have browsed it

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
Copy after login

3. Unzip tar -zxvf redis-4.3.0.tgz

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

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
Copy after login

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
Copy after login

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/"
Copy after login

Add extension = redis.so under extension_dir

7. Restart PHP

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

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!