Detailed graphic and text explanation of adding redis extension to php

不言
Release: 2023-03-23 14:24:02
Original
2144 people have browsed it

The content of this article is to share with you the detailed graphic and text explanation of adding redis extension to php. It has certain reference value. Friends in need can refer to it.

Recently, I want to study redis, just under php Added redis extension,

Specific steps

1. Download You can go to the official website to download https://pecl.php.net/package/redis

You can according to your own environment Select I downloaded 4.0

cd /usr/local/src/

wget https://pecl.php.net/get/redis -4.0.0.tgz

2. Unzip tar xvf redis-4.0.0.tgz

3. Use PHP configuration to generate configuration and enter redis

cd redis-4.0.0

## /usr/local/php/bin/phpize #php extended directory

4. Add to php extension

./configure --with-php-config=/usr/local/php/bin/php-config

make && make install

After execution

Remember the above path when adding extensions Use

5. Modify php.ini My php.ini is under /usr/local/php/etc/

vim /usr/local/php/etc/php.ini


Add the above extension path

extension =/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/redis.so


6. Restart php and see that php has not been extended.



Problem: There may be something wrong during the installation process The package is incomplete, just install the package

Related recommendations:

Add pcntl extension for php in Linux system

php Implementation code for generating static HTML articles when adding articles

Why does adding Composer auto-loading to ThinkPHP fail?




The above is the detailed content of Detailed graphic and text explanation of adding redis extension to php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template