zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

centos 下编译安装php7.3的redis扩展

2023-04-18 12:56:39 时间

centos 下编译安装php7.3的redis扩展

本文是基于 centos 下编译安装PHP7.3搭建PHP运行环境 编译安装版本,进行的redis的编译扩展安装方法整理。

下载redis扩展包以及解压

1
2

wget http://pecl.php.net/get/redis-4.2.0.tgz
tar -xzvf redis-4.2.0.tgz -C /opt/module

进入解压后目录,编译安装

1
2

cd /opt/module/redis-4.2.0
/usr/local/php/bin/phpize

常见错误

1
2
3
4
5

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

# 安装autoconf
yum install autoconf

查找php-config

1

find / -name php-config

编译安装

1
2

./configure --with-php-config=/usr/local/php/bin/php-config
make & make install

配置php.ini,添加redis.so扩展

1
2
3

vim /etc/php.ini

extension=redis.so

重启php-fpm

1
2

systemctl restart php-fpm

查看php扩展

1

php -m