Home  >  Article  >  Backend Development  >  php-redis extension installation and its problems

php-redis extension installation and its problems

不言
不言Original
2018-04-28 14:40:141539browse

The content of this article is about the php-redis extension installation and its problems. It has certain reference value. Now I share it with you. Friends in need can refer to it.

First check the operating system environment:

[root@jordy no-debug-non-zts-20170718]# cat /proc/version

Linux version 3.10.0-693.2.2.el7.x86_64 (builder@kbuilder. dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Tue Sep 12 22:26:13 UTC 2017
[root@jordy no-debug- non-zts-20170718]
#[root@jordy no-debug-non-zts-20170718]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1- noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708

Codename: Core

php version:

[root@jordy redis]# php -v
PHP 7.2.4 (cli ) (built: Apr 27 2018 18:08:43) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

redis version:

[root@jordy redis]# redis-server -v
Redis server v=4.0.9 sha=00000000:0 malloc=jemalloc-4.0.3 bits =64 build=c9d1038bab171720

php-redis version:

Go to the php extension official website (http://pecl.php.net/package/redis) to search for the redis extension, and then check Related version support:


Release 4.0.2: PHP Version: PHP version 7.9.99 or older
PHP Version: PHP 5.3.0 or newer
PEAR Package: PEAR 1.4.0b1 or newer

Selected php-redis 4.0.2 version:


Installation, four steps:

1./php/bin/phpize


##二 ./configure --with-php-config=/usr/local/php7/bin/php-config

三make

四make install


After the installation is completed, the final prompt is that the redis.so file has been generated in the following directory

/opt/server/php/lib/php/extensions/no-debug -non-zts-20170718/


Open the php configuration file php.ini

and then add extension=redis.so;

Install midway When, an error may be reported:

Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.

Indicate that the autoconf library is indeed true;
Then install it directly with yum This library can be:

yum install -y autoconf

Then follow the above steps to start it, ^_^

Then restart php-fpm

Then check the phpinfo page to see if it is ok:


As for autoconf and the details of autoconf making Makefile, we will talk about it later

^_^

Related recommendations:

php-redis extension installation (phpredis)

php-redis session operation


The above is the detailed content of php-redis extension installation and its problems. 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